<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0042)http://dev.w3.org/html5/spec/Overview.html -->
<HTML lang="en-US-x-Hixie"><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><TITLE>HTML5</TITLE><STYLE type="text/css">
   pre { margin-left: 2em; white-space: pre-wrap; }
   h2 { margin: 3em 0 1em 0; }
   h3 { margin: 2.5em 0 1em 0; }
   h4 { margin: 2.5em 0 0.75em 0; }
   h5, h6 { margin: 2.5em 0 1em; }
   h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
   h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
   p { margin: 1em 0; }
   hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
   dl, dd { margin-top: 0; margin-bottom: 0; }
   dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
   dt + dt { margin-top: 0; }
   dd dt { margin-top: 0.25em; margin-bottom: 0; }
   dd p { margin-top: 0; }
   dd dl + p { margin-top: 1em; }
   dd table + p { margin-top: 1em; }
   p + * > li, dd li { margin: 1em 0; }
   dt, dfn { font-weight: bold; font-style: normal; }
   dt dfn { font-style: italic; }
   pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
   pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
   pre em { font-weight: bolder; font-style: normal; }
   @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
   var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
   table { border-collapse: collapse; border-style: hidden hidden none hidden; }
   table thead { border-bottom: solid; }
   table tbody th:first-child { border-left: solid; }
   table tbody th { text-align: left; }
   table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
   blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }

   .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
   .matrix, .matrix td { border: none; text-align: right; }
   .matrix { margin-left: 2em; }
   .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
   .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
   .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }

   .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
   img.extra { float: right; }
   pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
   pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
   pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
   pre.css:first-line { color: #AAAA50; }
   dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #EEFFEE; }
   hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
   dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
   dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
   dl.domintro dd p { margin: 0.5em 0; }
   dl.switch { padding-left: 2em; }
   dl.switch > dt { text-indent: -1.5em; }
   dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
   dl.triple { padding: 0 0 0 1em; }
   dl.triple dt, dl.triple dd { margin: 0; display: inline }
   dl.triple dt:after { content: ':'; }
   dl.triple dd:after { content: '\A'; white-space: pre; }
   .diff-old { text-decoration: line-through; color: silver; background: transparent; }
   .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
   a .diff-new { border-bottom: 1px blue solid; }

   h2 { page-break-before: always; }
   h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
   h1 + h2, hr + h2.no-toc { page-break-before: auto; }

   p > span:not([title=""]):not([class="XXX"]):not([class="impl"]), li > span:not([title=""]):not([class="XXX"]):not([class="impl"]) { border-bottom: solid #9999CC; }

   div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
   div.head p { margin: 0; }
   div.head h1 { margin: 0; }
   div.head .logo { float: right; margin: 0 1em; }
   div.head .logo img { border: none } /* remove border from top image */
   div.head dl { margin: 1em 0; }
   div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }

   body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
   body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
   body > .toc > li > * { margin-bottom: 0.5em; }
   body > .toc > li > * > li > * { margin-bottom: 0.25em; }
   .toc, .toc li { list-style: none; }

   .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
   .brief li { margin: 0; padding: 0; }
   .brief li p { margin: 0; padding: 0; }

   .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
   .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
   .category-list li { display: inline; }
   .category-list li:not(:last-child)::after { content: ', '; }
   .category-list li > span, .category-list li > a { text-transform: lowercase; }
   .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */

   .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
   .XXX > :first-child { margin-top: 0; }
   p .XXX { line-height: 3em; }
   .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
   .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
   .annotation :link, .annotation :visited { color: inherit; }
   .annotation :link:hover, .annotation :visited:hover { background: transparent; }
   .annotation span { border: none ! important; }
   .note { color: green; background: transparent; font-family: sans-serif; }
   .warning { color: red; background: transparent; }
   .note, .warning { font-weight: bolder; font-style: italic; }
   p.note, div.note { padding: 0.5em 2em; }
   span.note { padding: 0 2em; }
   .note p:first-child, .warning p:first-child { margin-top: 0; }
   .note p:last-child, .warning p:last-child { margin-bottom: 0; }
   .warning:before { font-style: normal; }
   p.note:before { content: 'Note: '; }
   p.warning:before { content: '\26A0 Warning! '; }

   .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
   .bookkeeping { font-size: 0.8em; margin: 2em 0; }
   .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }

   h4 { position: relative; z-index: 3; }
   h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
   .element {
     background: #EEEEFF;
     color: black;
     margin: 0 0 1em 0.15em;
     padding: 0 1em 0.25em 0.75em;
     border-left: solid #9999FF 0.25em;
     position: relative;
     z-index: 1;
   }
   .element:before {
     position: absolute;
     z-index: 2;
     top: 0;
     left: -1.15em;
     height: 2em;
     width: 0.9em;
     background: #EEEEFF;
     content: ' ';
     border-style: none none solid solid;
     border-color: #9999FF;
     border-width: 0.25em;
   }

   .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
   td > .example:only-child { margin: 0 0 0 0.1em; }

   .tall-and-narrow {
     font-size: 0.6em;
     column-width: 25em;
     column-gap: 1em;
     -moz-column-width: 25em;
     -moz-column-gap: 1em;
     -webkit-column-width: 25em;
     -webkit-column-gap: 1em;
   }

   ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
   ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
   ul.domTree li li { list-style: none; }
   ul.domTree li:first-child::before { position: absolute; top: 0; height: 0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
   ul.domTree li:not(:last-child)::after { position: absolute; top: 0; bottom: -0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
   ul.domTree span { font-style: italic; font-family: serif; }
   ul.domTree .t1 code { color: purple; font-weight: bold; }
   ul.domTree .t2 { font-style: normal; font-family: monospace; }
   ul.domTree .t2 .name { color: black; font-weight: bold; }
   ul.domTree .t2 .value { color: blue; font-weight: normal; }
   ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
   ul.domTree .t7 code, .domTree .t8 code { color: green; }
   ul.domTree .t10 code { color: teal; }

   #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
   #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
   #configUI p label { display: block; }
   #configUI #updateUI, #configUI .loginUI { text-align: center; }
   #configUI input[type=button] { display: block; margin: auto; }
  </STYLE><STYLE type="text/css">

   .applies thead th > * { display: block; }
   .applies thead code { display: block; }
   .applies tbody th { whitespace: nowrap; }
   .applies td { text-align: center; }
   .applies .yes { background: yellow; }

   .matrix, .matrix td { border: none; text-align: right; }
   .matrix { margin-left: 2em; }

   .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
   .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
   .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }

   #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
   #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
   #table-example-1 caption { padding-bottom: 0.5em; }
   #table-example-1 thead, #table-example-1 tbody { border: none; }
   #table-example-1 th, #table-example-1 td { border: solid thin; }
   #table-example-1 th { font-weight: normal; }
   #table-example-1 td { border-style: none solid; vertical-align: top; }
   #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
   #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
   #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
   #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
   #table-example-1 tbody td:first-child::after { content: leader(". "); }
   #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
   #table-example-1 tbody td:first-child + td { width: 10em; }
   #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
   #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }

   .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
   .apple-table-examples * { font-family: "Times", serif; }
   .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
   .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
   .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
   .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
   .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
   .apple-table-examples td { text-align: right; vertical-align: top; }
   .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
   .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
   .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
   .apple-table-examples sup { line-height: 0; }

   .details-example img { vertical-align: top; }

  </STYLE><LINK href="data:text/css," id="complete" rel="stylesheet" title="Complete specification"><LINK href="data:text/css,.impl%20{%20display:%20none;%20}" id="author" rel="alternate stylesheet" title="Author documentation only"><LINK href="data:text/css,.impl%20{%20background:%20%23FFEEEE;%20}" id="highlight" rel="alternate stylesheet" title="Highlight implementation requirements"><SCRIPT type="text/javascript">
   function getCookie(name) {
     var params = location.search.substr(1).split("&");
     for (var index = 0; index < params.length; index++) {
       if (params[index] == name)
         return "1";
       var data = params[index].split("=");
       if (data[0] == name)
         return unescape(data[1]);
     }
     var cookies = document.cookie.split("; ");
     for (var index = 0; index < cookies.length; index++) {
       var data = cookies[index].split("=");
       if (data[0] == name)
         return unescape(data[1]);
     }
     return null;
   }
   function load(script) {
     var e = document.createElement('script');
     e.setAttribute('src', 'http://www.whatwg.org/specs/web-apps/current-work/' + script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
     document.body.appendChild(e);
   }
   function init() {
     if (location.search == '?slow-browser')
       return;
     var configUI = document.createElement('div');
     configUI.id = 'configUI';
     document.body.appendChild(configUI);
     // load('reviewer.js'); // would need cross-site XHR
     if (document.getElementById('head'))
       load('toc.js');
     load('styler.js');
     // load('updater.js'); // would need cross-site XHR
     load('dfn.js'); // doesn't support split-out specs, but, oh well.
     // load('status.js'); // would need cross-site XHR
     if (getCookie('profile') == '1')
       document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
     fixBrokenLink();
   }
  </SCRIPT><LINK href="./HTML5_files/W3C-ED" rel="stylesheet" type="text/css"></HEAD><BODY onload="init()"><DIV class="head" id="head">
   <P><A href="http://www.w3.org/"><IMG alt="W3C" height="48" src="./HTML5_files/w3c_home" width="72"></A></P>
   <H1>HTML5</H1>
   <H2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</H2>

   <H2 class="no-num no-toc" id="editor-s-draft-24-january-2010">Editor's Draft 24 January 2010</H2>
   <DL><DT>Latest Published Version:</DT>
    <DD><A href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</A></DD>
    <DT>Latest Editor's Draft:</DT>
    <DD><A href="./HTML5_files/HTML5.htm">http://dev.w3.org/html5/spec/Overview.html</A></DD>
<!-- ZZZ: add the new version after it has shipped -->
    <DT>Previous Versions:</DT>
    <DD><A href="http://www.w3.org/TR/2009/WD-html5-20090825/">http://www.w3.org/TR/2009/WD-html5-20090825/</A></DD>
    <DD><A href="http://www.w3.org/TR/2009/WD-html5-20090423/">http://www.w3.org/TR/2009/WD-html5-20090423/</A></DD>
    <DD><A href="http://www.w3.org/TR/2009/WD-html5-20090212/">http://www.w3.org/TR/2009/WD-html5-20090212/</A></DD>
    <DD><A href="http://www.w3.org/TR/2008/WD-html5-20080610/">http://www.w3.org/TR/2008/WD-html5-20080610/</A></DD>
    <DD><A href="http://www.w3.org/TR/2008/WD-html5-20080122/">http://www.w3.org/TR/2008/WD-html5-20080122/</A></DD>
<!-- :ZZZ -->
    <DT>Editors:</DT>
    <DD><A href="mailto:ian@hixie.ch">Ian Hickson</A>, Google, Inc.</DD>
    <DD>David Hyatt, Apple, Inc.</DD>
   </DL><P>This specification is available in the following formats: 
    <A href="./HTML5_files/HTML5.htm">single page HTML</A>,
    <A href="http://dev.w3.org/html5/spec/spec.html">multipage HTML</A>.
    This is revision $Revision: 1.3687 $.
   </P> 
   <P class="copyright"><A href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</A>
   © 2009 <A href="http://www.w3.org/"><ABBR title="World Wide
   Web Consortium">W3C</ABBR></A><SUP>®</SUP> (<A href="http://www.csail.mit.edu/"><ABBR title="Massachusetts
   Institute of Technology">MIT</ABBR></A>, <A href="http://www.ercim.org/"><ABBR title="European Research
   Consortium for Informatics and Mathematics">ERCIM</ABBR></A>, <A href="http://www.keio.ac.jp/">Keio</A>), All Rights Reserved. W3C
   <A href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</A>,
   <A href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</A>
   and <A href="http://www.w3.org/Consortium/Legal/copyright-documents">document
   use</A> rules apply.</P>
  </DIV><HR class="top"><H2 class="no-num no-toc" id="abstract">Abstract</H2><P>This specification defines the 5th major revision of the core
  language of the World Wide Web: the Hypertext Markup Language
  (HTML). In this version, new features are introduced to help Web
  application authors, new elements are introduced based on research
  into prevailing authoring practices, and special attention has been
  given to defining clear conformance criteria for user agents in an
  effort to improve interoperability.</P><!--
  <p>This specification is part of the HTML5 series of
  specifications.</p>
--><H2 class="no-num no-toc" id="status-of-this-document">Status of This document</H2><!-- intro boilerplate (required) --><P><EM>This section describes the status of this document at the
  time of its publication. Other documents may supersede this
  document. A list of current W3C publications and the most recently
  formally published revision of this technical report can be found in
  the <A href="http://www.w3.org/TR/">W3C technical reports index</A>
  at http://www.w3.org/TR/.</EM></P><!-- where to send feedback (required) --><P>If you wish to make comments regarding this document, please send
  them to <A href="mailto:public-html-comments@w3.org">public-html-comments@w3.org</A>
  (<A href="mailto:public-html-comments-request@w3.org?subject=subscribe">subscribe</A>,
  <A href="http://lists.w3.org/Archives/Public/public-html-comments/">archives</A>)

  <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING SENTENCE TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->  
  or <A href="mailto:whatwg@whatwg.org">whatwg@whatwg.org</A> (<A href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">subscribe</A>,
  <A href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/">archives</A>),
  <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING SENTENCE TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->

  or submit them using <A href="http://www.w3.org/Bugs/Public/enter_bug.cgi?product=HTML%20WG">our
  public bug database</A>.

  All feedback is welcome.</P><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><P>The working groups maintains <A href="http://www.w3.org/Bugs/Public/buglist.cgi?component=Spec%20bugs&component=Spec%20proposals&product=HTML%20WG&resolution=NEEDSINFO&resolution=LATER&resolution=REMIND&resolution=---&order=bugs.resolution%2Cbugs.priority%2C%20bugs.bug_severity">a
  list of all bug reports that the editor has not yet tried to
  address</A> and <A href="http://www.w3.org/html/wg/tracker/products/1">a list of issues
  for which the chairs have not yet declared a decision</A>. The
  editor also maintains <A href="http://www.whatwg.org/issues/">a list
  of all e-mails that he has not yet tried to address</A>. These bugs,
  issues, and e-mails apply to all HTML specifications, not just this
  one.</P><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- stability (required) --><P>Implementors should be aware that this specification is not
  stable. <STRONG>Implementors who are not taking part in the
  discussions are likely to find the specification changing out from
  under them in incompatible ways.</STRONG> Vendors interested in
  implementing this specification before it eventually reaches the
  Candidate Recommendation stage should join the aforementioned
  mailing lists and take part in the discussions.</P><!-- not everyone agrees with html5 (requested before fpwd) --><P>The publication of this document by the W3C as a W3C Working
  Draft does not imply that all of the participants in the W3C HTML
  working group endorse the contents of the specification. Indeed, for
  any section of the specification, one can usually find many members
  of the working group or of the W3C as a whole who object strongly to
  the current text, the existence of the section at all, or the idea
  that the working group should even spend time discussing the concept
  of that section.</P><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- version history or list of changes (required) --><P>The latest stable version of the editor's draft of this
  specification is always available on <A href="http://dev.w3.org/html5/">the W3C CVS server</A> and in the <A href="http://svn.whatwg.org/webapps/">WHATWG Subversion
  repository</A>. The <A href="http://www.whatwg.org/specs/web-apps/current-work/complete.html">latest
  editor's working copy</A> (which may contain unfinished text in the
  process of being prepared) contains the latest draft text of this
  specification (amongst others). For more details, please see the <A href="http://wiki.whatwg.org/wiki/FAQ#What_are_the_various_versions_of_the_spec.3F">WHATWG
  FAQ</A>.</P><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><P>There are various ways to follow the change history for the
  HTML specifications:</P><DL><DT>E-mail notifications of changes</DT>
   <DD>HTML-Diffs mailing list (diff-marked HTML versions for each change): <A href="http://lists.w3.org/Archives/Public/public-html-diffs/latest">http://lists.w3.org/Archives/Public/public-html-diffs/latest</A></DD>
   <DD>Commit-Watchers mailing list (complete source diffs): <A href="http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org">http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org</A></DD>
   <DT>Real-time notifications of changes:</DT>
   <DD>Generated diff-marked HTML versions for each change: <A href="http://twitter.com/HTML5">http://twitter.com/HTML5</A></DD>
   <DD>All (non-editorial) changes to the spec source: <A href="http://twitter.com/WHATWG">http://twitter.com/WHATWG</A></DD>
   <DT>Browsable version-control record of all changes:</DT>
   <DD>CVSWeb interface with side-by-side diffs: <A href="http://dev.w3.org/cvsweb/html5/">http://dev.w3.org/cvsweb/html5/</A></DD>
   <DD>Annotated summary with unified diffs: <A href="http://html5.org/tools/web-apps-tracker">http://html5.org/tools/web-apps-tracker</A></DD>
   <DD>Raw Subversion interface: <CODE>svn checkout http://svn.whatwg.org/webapps/</CODE></DD>
  </DL><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- status of document, group responsible (required) --><P>The W3C <A href="http://www.w3.org/html/wg/">HTML Working
  Group</A> is the W3C working group responsible for this
  specification's progress along the W3C Recommendation
  track.

  This specification is the 24 January 2010 Editor's Draft.
  </P><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><P>This specification is part of <A href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">a
  larger specification</A> being produced by the <A href="http://www.whatwg.org/">WHATWG</A>.
  <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->


  <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
  <!-- context and rationale (required) -->
  This specification is a module that forms part of the HTML5 series
  of specifications published at the W3C. It is published separate
  from other modules of HTML5 in a manner consistent with the
  principles of maturity, market success, and reusability in other
  languages described in the <A href="http://lists.w3.org/Archives/Public/public-html/2010Jan/att-0218/issue-76-decision.html">Working
  Group Decision</A> published on January 7th 2010.  The HTML5 series
  of specifications is intended to replace (be a new version of) what
  was previously the HTML4, XHTML1, and DOM2 HTML specifications.
  </P><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- required patent boilerplate --><P>This document was produced by a group operating under the <A href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
  February 2004 W3C Patent Policy</A>. W3C maintains a <A href="http://www.w3.org/2004/01/pp-impl/40318/status" rel="disclosure">public list of
  any patent disclosures</A> made in connection with the deliverables
  of the group; that page also includes instructions for disclosing a
  patent. An individual who has actual knowledge of a patent which the
  individual believes contains <A href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
  Claim(s)</A> must disclose the information in accordance with <A href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
  6 of the W3C Patent Policy</A>.</P><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- temporarily moved to Status of this Document after discussion with plh in October 2009 --><!-- will be moved back to below W3C copyright in April 2009 --><P class="alt">The <A href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">WHATWG
   version</A> of this specification is available under a license that
   permits reuse of the specification text.</P><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><H2 class="no-num no-toc" id="contents">Table of Contents</H2>
<!--begin-toc-->
<OL class="toc">
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction"><SPAN class="secno">1 </SPAN>Introduction</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#background"><SPAN class="secno">1.1 </SPAN>Background</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#audience"><SPAN class="secno">1.2 </SPAN>Audience</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scope"><SPAN class="secno">1.3 </SPAN>Scope</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#history-1"><SPAN class="secno">1.4 </SPAN>History</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#design-notes"><SPAN class="secno">1.5 </SPAN>Design notes</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#serializability-of-script-execution"><SPAN class="secno">1.5.1 </SPAN>Serializability of script execution</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#compliance-with-other-specifications"><SPAN class="secno">1.5.2 </SPAN>Compliance with other specifications</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#html-vs-xhtml"><SPAN class="secno">1.6 </SPAN>HTML vs XHTML</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#structure-of-this-specification"><SPAN class="secno">1.7 </SPAN>Structure of this specification</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#how-to-read-this-specification"><SPAN class="secno">1.7.1 </SPAN>How to read this specification</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#typographic-conventions"><SPAN class="secno">1.7.2 </SPAN>Typographic conventions</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-quick-introduction-to-html"><SPAN class="secno">1.8 </SPAN>A quick introduction to HTML</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#recommended-reading"><SPAN class="secno">1.9 </SPAN>Recommended reading</A></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#infrastructure"><SPAN class="secno">2 </SPAN>Common infrastructure</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#terminology"><SPAN class="secno">2.1 </SPAN>Terminology</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#resources"><SPAN class="secno">2.1.1 </SPAN>Resources</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#xml"><SPAN class="secno">2.1.2 </SPAN>XML</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dom-trees"><SPAN class="secno">2.1.3 </SPAN>DOM trees</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scripting-0"><SPAN class="secno">2.1.4 </SPAN>Scripting</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#plugins"><SPAN class="secno">2.1.5 </SPAN>Plugins</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#character-encodings"><SPAN class="secno">2.1.6 </SPAN>Character encodings</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#conformance-requirements"><SPAN class="secno">2.2 </SPAN>Conformance requirements</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dependencies"><SPAN class="secno">2.2.1 </SPAN>Dependencies</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#extensibility"><SPAN class="secno">2.2.2 </SPAN>Extensibility</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitivity-and-string-comparison"><SPAN class="secno">2.3 </SPAN>Case-sensitivity and string comparison</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#common-microsyntaxes"><SPAN class="secno">2.4 </SPAN>Common microsyntaxes</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#common-parser-idioms"><SPAN class="secno">2.4.1 </SPAN>Common parser idioms</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#boolean-attributes"><SPAN class="secno">2.4.2 </SPAN>Boolean attributes</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#keywords-and-enumerated-attributes"><SPAN class="secno">2.4.3 </SPAN>Keywords and enumerated attributes</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#numbers"><SPAN class="secno">2.4.4 </SPAN>Numbers</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#non-negative-integers"><SPAN class="secno">2.4.4.1 </SPAN>Non-negative integers</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#signed-integers"><SPAN class="secno">2.4.4.2 </SPAN>Signed integers</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#real-numbers"><SPAN class="secno">2.4.4.3 </SPAN>Real numbers</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#percentages-and-dimensions"><SPAN class="secno">2.4.4.4 </SPAN>Percentages and lengths</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#lists-of-integers"><SPAN class="secno">2.4.4.5 </SPAN>Lists of integers</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#lists-of-dimensions"><SPAN class="secno">2.4.4.6 </SPAN>Lists of dimensions</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dates-and-times"><SPAN class="secno">2.4.5 </SPAN>Dates and times</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#months"><SPAN class="secno">2.4.5.1 </SPAN>Months</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dates"><SPAN class="secno">2.4.5.2 </SPAN>Dates</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#times"><SPAN class="secno">2.4.5.3 </SPAN>Times</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#local-dates-and-times"><SPAN class="secno">2.4.5.4 </SPAN>Local dates and times</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#global-dates-and-times"><SPAN class="secno">2.4.5.5 </SPAN>Global dates and times</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#weeks"><SPAN class="secno">2.4.5.6 </SPAN>Weeks</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#vaguer-moments-in-time"><SPAN class="secno">2.4.5.7 </SPAN>Vaguer moments in time</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#colors"><SPAN class="secno">2.4.6 </SPAN>Colors</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#space-separated-tokens"><SPAN class="secno">2.4.7 </SPAN>Space-separated tokens</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comma-separated-tokens"><SPAN class="secno">2.4.8 </SPAN>Comma-separated tokens</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#syntax-references"><SPAN class="secno">2.4.9 </SPAN>References</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#mq"><SPAN class="secno">2.4.10 </SPAN>Media queries</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#urls"><SPAN class="secno">2.5 </SPAN>URLs</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#terminology-0"><SPAN class="secno">2.5.1 </SPAN>Terminology</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dynamic-changes-to-base-urls"><SPAN class="secno">2.5.2 </SPAN>Dynamic changes to base URLs</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#interfaces-for-url-manipulation"><SPAN class="secno">2.5.3 </SPAN>Interfaces for URL manipulation</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#fetching-resources"><SPAN class="secno">2.6 </SPAN>Fetching resources</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#concept-http-equivalent"><SPAN class="secno">2.6.1 </SPAN>Protocol concepts</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#encrypted-http-and-related-security-concerns"><SPAN class="secno">2.6.2 </SPAN>Encrypted HTTP and related security concerns</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#content-type-sniffing"><SPAN class="secno">2.6.3 </SPAN>Determining the type of a resource</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#common-dom-interfaces"><SPAN class="secno">2.7 </SPAN>Common DOM interfaces</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#reflecting-content-attributes-in-idl-attributes"><SPAN class="secno">2.7.1 </SPAN>Reflecting content attributes in IDL attributes</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#collections-0"><SPAN class="secno">2.7.2 </SPAN>Collections</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection-0"><SPAN class="secno">2.7.2.1 </SPAN>HTMLCollection</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection-0"><SPAN class="secno">2.7.2.2 </SPAN>HTMLAllCollection</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#htmlformcontrolscollection-0"><SPAN class="secno">2.7.2.3 </SPAN>HTMLFormControlsCollection</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection-0"><SPAN class="secno">2.7.2.4 </SPAN>HTMLOptionsCollection</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist-0"><SPAN class="secno">2.7.3 </SPAN>DOMTokenList</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#domsettabletokenlist-0"><SPAN class="secno">2.7.4 </SPAN>DOMSettableTokenList</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#safe-passing-of-structured-data"><SPAN class="secno">2.7.5 </SPAN>Safe passing of structured data</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap-0"><SPAN class="secno">2.7.6 </SPAN>DOMStringMap</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dom-feature-strings"><SPAN class="secno">2.7.7 </SPAN>DOM feature strings</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#exceptions"><SPAN class="secno">2.7.8 </SPAN>Exceptions</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#garbage-collection"><SPAN class="secno">2.7.9 </SPAN>Garbage collection</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#namespaces"><SPAN class="secno">2.8 </SPAN>Namespaces</A></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dom"><SPAN class="secno">3 </SPAN>Semantics, structure, and APIs of HTML documents</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#documents"><SPAN class="secno">3.1 </SPAN>Documents</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#documents-in-the-dom"><SPAN class="secno">3.1.1 </SPAN>Documents in the DOM</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security"><SPAN class="secno">3.1.2 </SPAN>Security</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#resource-metadata-management"><SPAN class="secno">3.1.3 </SPAN>Resource metadata management</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tree-accessors"><SPAN class="secno">3.1.4 </SPAN>DOM tree accessors</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#creating-documents"><SPAN class="secno">3.1.5 </SPAN>Creating documents</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#elements"><SPAN class="secno">3.2 </SPAN>Elements</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#semantics-0"><SPAN class="secno">3.2.1 </SPAN>Semantics</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#elements-in-the-dom"><SPAN class="secno">3.2.2 </SPAN>Elements in the DOM</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#global-attributes"><SPAN class="secno">3.2.3 </SPAN>Global attributes</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute"><SPAN class="secno">3.2.3.1 </SPAN>The <CODE>id</CODE> attribute</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute"><SPAN class="secno">3.2.3.2 </SPAN>The <CODE>title</CODE> attribute</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-lang-and-xml:lang-attributes"><SPAN class="secno">3.2.3.3 </SPAN>The <CODE title="attr-lang">lang</CODE> and <CODE title="attr-xml-lang">xml:lang</CODE> attributes</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-xml:base-attribute-xml-only"><SPAN class="secno">3.2.3.4 </SPAN>The <CODE>xml:base</CODE>
  attribute (XML only)</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute"><SPAN class="secno">3.2.3.5 </SPAN>The <CODE>dir</CODE> attribute</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#classes"><SPAN class="secno">3.2.3.6 </SPAN>The <CODE>class</CODE> attribute</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute"><SPAN class="secno">3.2.3.7 </SPAN>The <CODE>style</CODE> attribute</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#embedding-custom-non-visible-data"><SPAN class="secno">3.2.3.8 </SPAN>Embedding custom non-visible data</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#element-definitions"><SPAN class="secno">3.2.4 </SPAN>Element definitions</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#content-models"><SPAN class="secno">3.2.5 </SPAN>Content models</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#kinds-of-content"><SPAN class="secno">3.2.5.1 </SPAN>Kinds of content</A>
        <OL>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content-0"><SPAN class="secno">3.2.5.1.1 </SPAN>Metadata content</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#flow-content-0"><SPAN class="secno">3.2.5.1.2 </SPAN>Flow content</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#sectioning-content-0"><SPAN class="secno">3.2.5.1.3 </SPAN>Sectioning content</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#heading-content-0"><SPAN class="secno">3.2.5.1.4 </SPAN>Heading content</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content-0"><SPAN class="secno">3.2.5.1.5 </SPAN>Phrasing content</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content-0"><SPAN class="secno">3.2.5.1.6 </SPAN>Embedded content</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#interactive-content-0"><SPAN class="secno">3.2.5.1.7 </SPAN>Interactive content</A></LI></OL></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#transparent-content-models"><SPAN class="secno">3.2.5.2 </SPAN>Transparent content models</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#paragraphs"><SPAN class="secno">3.2.5.3 </SPAN>Paragraphs</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#annotations-for-assistive-technology-products-aria"><SPAN class="secno">3.2.6 </SPAN>Annotations for assistive technology products (ARIA)</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#apis-in-html-documents"><SPAN class="secno">3.3 </SPAN>APIs in HTML documents</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#interactions-with-xpath-and-xslt"><SPAN class="secno">3.4 </SPAN>Interactions with XPath and XSLT</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dynamic-markup-insertion"><SPAN class="secno">3.5 </SPAN>Dynamic markup insertion</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#opening-the-input-stream"><SPAN class="secno">3.5.1 </SPAN>Opening the input stream</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#closing-the-input-stream"><SPAN class="secno">3.5.2 </SPAN>Closing the input stream</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#document.write"><SPAN class="secno">3.5.3 </SPAN><CODE title="dom-document-write">document.write()</CODE></A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#document.writeln"><SPAN class="secno">3.5.4 </SPAN><CODE title="dom-document-writeln">document.writeln()</CODE></A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#innerhtml"><SPAN class="secno">3.5.5 </SPAN><CODE title="dom-innerHTML">innerHTML</CODE></A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#outerhtml"><SPAN class="secno">3.5.6 </SPAN><CODE title="dom-outerHTML">outerHTML</CODE></A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#insertadjacenthtml"><SPAN class="secno">3.5.7 </SPAN><CODE title="dom-insertAdjacentHTML">insertAdjacentHTML()</CODE></A></LI></OL></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#semantics"><SPAN class="secno">4 </SPAN>The elements of HTML</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-root-element"><SPAN class="secno">4.1 </SPAN>The root element</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0"><SPAN class="secno">4.1.1 </SPAN>The <CODE>html</CODE> element</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#document-metadata"><SPAN class="secno">4.2 </SPAN>Document metadata</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0"><SPAN class="secno">4.2.1 </SPAN>The <CODE>head</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0"><SPAN class="secno">4.2.2 </SPAN>The <CODE>title</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element"><SPAN class="secno">4.2.3 </SPAN>The <CODE>base</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element"><SPAN class="secno">4.2.4 </SPAN>The <CODE>link</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#meta"><SPAN class="secno">4.2.5 </SPAN>The <CODE>meta</CODE> element</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#standard-metadata-names"><SPAN class="secno">4.2.5.1 </SPAN>Standard metadata names</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#other-metadata-names"><SPAN class="secno">4.2.5.2 </SPAN>Other metadata names</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#pragma-directives"><SPAN class="secno">4.2.5.3 </SPAN>Pragma directives</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#other-pragma-directives"><SPAN class="secno">4.2.5.4 </SPAN>Other pragma directives</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#charset"><SPAN class="secno">4.2.5.5 </SPAN>Specifying the document's character encoding</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-element"><SPAN class="secno">4.2.6 </SPAN>The <CODE>style</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#styling"><SPAN class="secno">4.2.7 </SPAN>Styling</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scripting-1"><SPAN class="secno">4.3 </SPAN>Scripting</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script"><SPAN class="secno">4.3.1 </SPAN>The <CODE>script</CODE> element</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scriptingLanguages"><SPAN class="secno">4.3.1.1 </SPAN>Scripting languages</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#restrictions-for-contents-of-script-elements"><SPAN class="secno">4.3.1.2 </SPAN>Restrictions for contents of <CODE>script</CODE> elements</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#inline-documentation-for-external-scripts"><SPAN class="secno">4.3.1.3 </SPAN>Inline documentation for external scripts</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-noscript-element"><SPAN class="secno">4.3.2 </SPAN>The <CODE>noscript</CODE> element</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#sections"><SPAN class="secno">4.4 </SPAN>Sections</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0"><SPAN class="secno">4.4.1 </SPAN>The <CODE>body</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-section-element"><SPAN class="secno">4.4.2 </SPAN>The <CODE>section</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-nav-element"><SPAN class="secno">4.4.3 </SPAN>The <CODE>nav</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-article-element"><SPAN class="secno">4.4.4 </SPAN>The <CODE>article</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-aside-element"><SPAN class="secno">4.4.5 </SPAN>The <CODE>aside</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements"><SPAN class="secno">4.4.6 </SPAN>The <CODE>h1</CODE>, <CODE>h2</CODE>,
  <CODE>h3</CODE>, <CODE>h4</CODE>,
  <CODE>h5</CODE>, and <CODE>h6</CODE>
  elements</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element"><SPAN class="secno">4.4.7 </SPAN>The <CODE>hgroup</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-header-element"><SPAN class="secno">4.4.8 </SPAN>The <CODE>header</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-footer-element"><SPAN class="secno">4.4.9 </SPAN>The <CODE>footer</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-address-element"><SPAN class="secno">4.4.10 </SPAN>The <CODE>address</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#headings-and-sections"><SPAN class="secno">4.4.11 </SPAN>Headings and sections</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#outlines"><SPAN class="secno">4.4.11.1 </SPAN>Creating an outline</A></LI></OL></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#grouping-content"><SPAN class="secno">4.5 </SPAN>Grouping content</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element"><SPAN class="secno">4.5.1 </SPAN>The <CODE>p</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-hr-element"><SPAN class="secno">4.5.2 </SPAN>The <CODE>hr</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-br-element"><SPAN class="secno">4.5.3 </SPAN>The <CODE>br</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-pre-element"><SPAN class="secno">4.5.4 </SPAN>The <CODE>pre</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-blockquote-element"><SPAN class="secno">4.5.5 </SPAN>The <CODE>blockquote</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-ol-element"><SPAN class="secno">4.5.6 </SPAN>The <CODE>ol</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-ul-element"><SPAN class="secno">4.5.7 </SPAN>The <CODE>ul</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-li-element"><SPAN class="secno">4.5.8 </SPAN>The <CODE>li</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-dl-element"><SPAN class="secno">4.5.9 </SPAN>The <CODE>dl</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-dt-element"><SPAN class="secno">4.5.10 </SPAN>The <CODE>dt</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-dd-element"><SPAN class="secno">4.5.11 </SPAN>The <CODE>dd</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-div-element"><SPAN class="secno">4.5.12 </SPAN>The <CODE>div</CODE> element</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-level-semantics"><SPAN class="secno">4.6 </SPAN>Text-level semantics</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element"><SPAN class="secno">4.6.1 </SPAN>The <CODE>a</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-em-element"><SPAN class="secno">4.6.2 </SPAN>The <CODE>em</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-strong-element"><SPAN class="secno">4.6.3 </SPAN>The <CODE>strong</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-small-element"><SPAN class="secno">4.6.4 </SPAN>The <CODE>small</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-cite-element"><SPAN class="secno">4.6.5 </SPAN>The <CODE>cite</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-q-element"><SPAN class="secno">4.6.6 </SPAN>The <CODE>q</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-dfn-element"><SPAN class="secno">4.6.7 </SPAN>The <CODE>dfn</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-abbr-element"><SPAN class="secno">4.6.8 </SPAN>The <CODE>abbr</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-time-element"><SPAN class="secno">4.6.9 </SPAN>The <CODE>time</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-code-element"><SPAN class="secno">4.6.10 </SPAN>The <CODE>code</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-var-element"><SPAN class="secno">4.6.11 </SPAN>The <CODE>var</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-samp-element"><SPAN class="secno">4.6.12 </SPAN>The <CODE>samp</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-kbd-element"><SPAN class="secno">4.6.13 </SPAN>The <CODE>kbd</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-sub-and-sup-elements"><SPAN class="secno">4.6.14 </SPAN>The <CODE>sub</CODE> and <CODE>sup</CODE> elements</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-i-element"><SPAN class="secno">4.6.15 </SPAN>The <CODE>i</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-b-element"><SPAN class="secno">4.6.16 </SPAN>The <CODE>b</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-mark-element"><SPAN class="secno">4.6.17 </SPAN>The <CODE>mark</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-ruby-element"><SPAN class="secno">4.6.18 </SPAN>The <CODE>ruby</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-rt-element"><SPAN class="secno">4.6.19 </SPAN>The <CODE>rt</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-rp-element"><SPAN class="secno">4.6.20 </SPAN>The <CODE>rp</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-bdo-element"><SPAN class="secno">4.6.21 </SPAN>The <CODE>bdo</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-span-element"><SPAN class="secno">4.6.22 </SPAN>The <CODE>span</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#usage-summary"><SPAN class="secno">4.6.23 </SPAN>Usage summary</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#edits"><SPAN class="secno">4.7 </SPAN>Edits</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element"><SPAN class="secno">4.7.1 </SPAN>The <CODE>ins</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element"><SPAN class="secno">4.7.2 </SPAN>The <CODE>del</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attributes-common-to-ins-and-del-elements"><SPAN class="secno">4.7.3 </SPAN>Attributes common to <CODE>ins</CODE> and <CODE>del</CODE> elements</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#edits-and-paragraphs"><SPAN class="secno">4.7.4 </SPAN>Edits and paragraphs</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#edits-and-lists"><SPAN class="secno">4.7.5 </SPAN>Edits and lists</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content-1"><SPAN class="secno">4.8 </SPAN>Embedded content</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-figure-element"><SPAN class="secno">4.8.1 </SPAN>The <CODE>figure</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element"><SPAN class="secno">4.8.2 </SPAN>The <CODE>img</CODE> element</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#alt"><SPAN class="secno">4.8.2.1 </SPAN>Requirements for providing text to act as an alternative for images</A>
        <OL>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-link-or-button-containing-nothing-but-the-image"><SPAN class="secno">4.8.2.1.1 </SPAN>A link or button containing nothing but the image</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-phrase-or-paragraph-with-an-alternative-graphical-representation:-charts-diagrams-graphs-maps-illustrations"><SPAN class="secno">4.8.2.1.2 </SPAN>A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-short-phrase-or-label-with-an-alternative-graphical-representation:-icons-logos"><SPAN class="secno">4.8.2.1.3 </SPAN>A short phrase or label with an alternative graphical representation: icons, logos</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-that-has-been-rendered-to-a-graphic-for-typographical-effect"><SPAN class="secno">4.8.2.1.4 </SPAN>Text that has been rendered to a graphic for typographical effect</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-graphical-representation-of-some-of-the-surrounding-text"><SPAN class="secno">4.8.2.1.5 </SPAN>A graphical representation of some of the surrounding text</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-purely-decorative-image-that-doesn-t-add-any-information"><SPAN class="secno">4.8.2.1.6 </SPAN>A purely decorative image that doesn't add any information</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-group-of-images-that-form-a-single-larger-picture-with-no-links"><SPAN class="secno">4.8.2.1.7 </SPAN>A group of images that form a single larger picture with no links</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-group-of-images-that-form-a-single-larger-picture-with-links"><SPAN class="secno">4.8.2.1.8 </SPAN>A group of images that form a single larger picture with links</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-key-part-of-the-content"><SPAN class="secno">4.8.2.1.9 </SPAN>A key part of the content</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#an-image-not-intended-for-the-user"><SPAN class="secno">4.8.2.1.10 </SPAN>An image not intended for the user</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#an-image-in-an-e-mail-or-private-document-intended-for-a-specific-person-who-is-known-to-be-able-to-view-images"><SPAN class="secno">4.8.2.1.11 </SPAN>An image in an e-mail or private document intended for a specific person who is known to be able to view images</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#general-guidelines"><SPAN class="secno">4.8.2.1.12 </SPAN>General guidelines</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#guidance-for-markup-generators"><SPAN class="secno">4.8.2.1.13 </SPAN>Guidance for markup generators</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#guidance-for-conformance-checkers"><SPAN class="secno">4.8.2.1.14 </SPAN>Guidance for conformance checkers</A></LI></OL></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element"><SPAN class="secno">4.8.3 </SPAN>The <CODE>iframe</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element"><SPAN class="secno">4.8.4 </SPAN>The <CODE>embed</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element"><SPAN class="secno">4.8.5 </SPAN>The <CODE>object</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-param-element"><SPAN class="secno">4.8.6 </SPAN>The <CODE>param</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#video"><SPAN class="secno">4.8.7 </SPAN>The <CODE>video</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#audio"><SPAN class="secno">4.8.8 </SPAN>The <CODE>audio</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-source-element"><SPAN class="secno">4.8.9 </SPAN>The <CODE>source</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#media-elements"><SPAN class="secno">4.8.10 </SPAN>Media elements</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#error-codes"><SPAN class="secno">4.8.10.1 </SPAN>Error codes</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#location-of-the-media-resource"><SPAN class="secno">4.8.10.2 </SPAN>Location of the media resource</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#mime-types"><SPAN class="secno">4.8.10.3 </SPAN>MIME types</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#network-states"><SPAN class="secno">4.8.10.4 </SPAN>Network states</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#loading-the-media-resource"><SPAN class="secno">4.8.10.5 </SPAN>Loading the media resource</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#offsets-into-the-media-resource"><SPAN class="secno">4.8.10.6 </SPAN>Offsets into the media resource</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-ready-states"><SPAN class="secno">4.8.10.7 </SPAN>The ready states</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#playing-the-media-resource"><SPAN class="secno">4.8.10.8 </SPAN>Playing the media resource</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#seeking"><SPAN class="secno">4.8.10.9 </SPAN>Seeking</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#user-interface"><SPAN class="secno">4.8.10.10 </SPAN>User interface</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#time-ranges"><SPAN class="secno">4.8.10.11 </SPAN>Time ranges</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#mediaevents"><SPAN class="secno">4.8.10.12 </SPAN>Event summary</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-and-privacy-considerations"><SPAN class="secno">4.8.10.13 </SPAN>Security and privacy considerations</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element"><SPAN class="secno">4.8.11 </SPAN>The <CODE>canvas</CODE> element</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#color-spaces-and-color-correction"><SPAN class="secno">4.8.11.1 </SPAN>Color spaces and color correction</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-with-canvas-elements"><SPAN class="secno">4.8.11.2 </SPAN>Security with <CODE>canvas</CODE> elements</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element"><SPAN class="secno">4.8.12 </SPAN>The <CODE>map</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element"><SPAN class="secno">4.8.13 </SPAN>The <CODE>area</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#image-maps"><SPAN class="secno">4.8.14 </SPAN>Image maps</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#authoring"><SPAN class="secno">4.8.14.1 </SPAN>Authoring</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#processing-model"><SPAN class="secno">4.8.14.2 </SPAN>Processing model</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#mathml"><SPAN class="secno">4.8.15 </SPAN>MathML</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#svg-0"><SPAN class="secno">4.8.16 </SPAN>SVG</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dimension-attributes"><SPAN class="secno">4.8.17 </SPAN>Dimension attributes</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#tabular-data"><SPAN class="secno">4.9 </SPAN>Tabular data</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-table-element"><SPAN class="secno">4.9.1 </SPAN>The <CODE>table</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-caption-element"><SPAN class="secno">4.9.2 </SPAN>The <CODE>caption</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-colgroup-element"><SPAN class="secno">4.9.3 </SPAN>The <CODE>colgroup</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-col-element"><SPAN class="secno">4.9.4 </SPAN>The <CODE>col</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-tbody-element"><SPAN class="secno">4.9.5 </SPAN>The <CODE>tbody</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-thead-element"><SPAN class="secno">4.9.6 </SPAN>The <CODE>thead</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-tfoot-element"><SPAN class="secno">4.9.7 </SPAN>The <CODE>tfoot</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-tr-element"><SPAN class="secno">4.9.8 </SPAN>The <CODE>tr</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-td-element"><SPAN class="secno">4.9.9 </SPAN>The <CODE>td</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-th-element"><SPAN class="secno">4.9.10 </SPAN>The <CODE>th</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attributes-common-to-td-and-th-elements"><SPAN class="secno">4.9.11 </SPAN>Attributes common to <CODE>td</CODE> and <CODE>th</CODE> elements</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#processing-model-0"><SPAN class="secno">4.9.12 </SPAN>Processing model</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#forming-a-table"><SPAN class="secno">4.9.12.1 </SPAN>Forming a table</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#header-and-data-cell-semantics"><SPAN class="secno">4.9.12.2 </SPAN>Forming relationships between data cells and header cells</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#examples"><SPAN class="secno">4.9.13 </SPAN>Examples</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#forms"><SPAN class="secno">4.10 </SPAN>Forms</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element"><SPAN class="secno">4.10.1 </SPAN>The <CODE>form</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-fieldset-element"><SPAN class="secno">4.10.2 </SPAN>The <CODE>fieldset</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-legend-element"><SPAN class="secno">4.10.3 </SPAN>The <CODE>legend</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-label-element"><SPAN class="secno">4.10.4 </SPAN>The <CODE>label</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element"><SPAN class="secno">4.10.5 </SPAN>The <CODE>input</CODE> element</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#states-of-the-type-attribute"><SPAN class="secno">4.10.5.1 </SPAN>States of the <CODE title="attr-input-type">type</CODE> attribute</A>
        <OL>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#hidden-state"><SPAN class="secno">4.10.5.1.1 </SPAN>Hidden state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-state-and-search-state"><SPAN class="secno">4.10.5.1.2 </SPAN>Text state and Search state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#telephone-state"><SPAN class="secno">4.10.5.1.3 </SPAN>Telephone state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#url-state"><SPAN class="secno">4.10.5.1.4 </SPAN>URL state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#e-mail-state"><SPAN class="secno">4.10.5.1.5 </SPAN>E-mail state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#password-state"><SPAN class="secno">4.10.5.1.6 </SPAN>Password state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#date-and-time-state"><SPAN class="secno">4.10.5.1.7 </SPAN>Date and Time state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#date-state"><SPAN class="secno">4.10.5.1.8 </SPAN>Date state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#month-state"><SPAN class="secno">4.10.5.1.9 </SPAN>Month state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#week-state"><SPAN class="secno">4.10.5.1.10 </SPAN>Week state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#time-state"><SPAN class="secno">4.10.5.1.11 </SPAN>Time state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#local-date-and-time-state"><SPAN class="secno">4.10.5.1.12 </SPAN>Local Date and Time state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#number-state"><SPAN class="secno">4.10.5.1.13 </SPAN>Number state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#range-state"><SPAN class="secno">4.10.5.1.14 </SPAN>Range state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#color-state"><SPAN class="secno">4.10.5.1.15 </SPAN>Color state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#checkbox-state"><SPAN class="secno">4.10.5.1.16 </SPAN>Checkbox state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#radio-button-state"><SPAN class="secno">4.10.5.1.17 </SPAN>Radio Button state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#file-upload-state"><SPAN class="secno">4.10.5.1.18 </SPAN>File Upload state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#submit-button-state"><SPAN class="secno">4.10.5.1.19 </SPAN>Submit Button state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#image-button-state"><SPAN class="secno">4.10.5.1.20 </SPAN>Image Button state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#reset-button-state"><SPAN class="secno">4.10.5.1.21 </SPAN>Reset Button state</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#button-state"><SPAN class="secno">4.10.5.1.22 </SPAN>Button state</A></LI></OL></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#common-input-element-attributes"><SPAN class="secno">4.10.5.2 </SPAN>Common <CODE>input</CODE> element attributes</A>
        <OL>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-autocomplete-attribute"><SPAN class="secno">4.10.5.2.1 </SPAN>The <CODE title="attr-input-autocomplete">autocomplete</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-list-attribute"><SPAN class="secno">4.10.5.2.2 </SPAN>The <CODE title="attr-input-list">list</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-readonly-attribute"><SPAN class="secno">4.10.5.2.3 </SPAN>The <CODE title="attr-input-readonly">readonly</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-size-attribute"><SPAN class="secno">4.10.5.2.4 </SPAN>The <CODE title="attr-input-size">size</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-required-attribute"><SPAN class="secno">4.10.5.2.5 </SPAN>The <CODE title="attr-input-required">required</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-multiple-attribute"><SPAN class="secno">4.10.5.2.6 </SPAN>The <CODE title="attr-input-multiple">multiple</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-maxlength-attribute"><SPAN class="secno">4.10.5.2.7 </SPAN>The <CODE title="attr-input-maxlength">maxlength</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-pattern-attribute"><SPAN class="secno">4.10.5.2.8 </SPAN>The <CODE title="attr-input-pattern">pattern</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-min-and-max-attributes"><SPAN class="secno">4.10.5.2.9 </SPAN>The <CODE title="attr-input-min">min</CODE> and <CODE title="attr-input-max">max</CODE> attributes</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-step-attribute"><SPAN class="secno">4.10.5.2.10 </SPAN>The <CODE title="attr-input-step">step</CODE> attribute</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-placeholder-attribute"><SPAN class="secno">4.10.5.2.11 </SPAN>The <CODE title="attr-input-placeholder">placeholder</CODE> attribute</A></LI></OL></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#common-input-element-apis"><SPAN class="secno">4.10.5.3 </SPAN>Common <CODE>input</CODE> element APIs</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#common-event-behaviors"><SPAN class="secno">4.10.5.4 </SPAN>Common event behaviors</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-button-element"><SPAN class="secno">4.10.6 </SPAN>The <CODE>button</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element"><SPAN class="secno">4.10.7 </SPAN>The <CODE>select</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-datalist-element"><SPAN class="secno">4.10.8 </SPAN>The <CODE>datalist</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-optgroup-element"><SPAN class="secno">4.10.9 </SPAN>The <CODE>optgroup</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element"><SPAN class="secno">4.10.10 </SPAN>The <CODE>option</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-textarea-element"><SPAN class="secno">4.10.11 </SPAN>The <CODE>textarea</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-keygen-element"><SPAN class="secno">4.10.12 </SPAN>The <CODE>keygen</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-output-element"><SPAN class="secno">4.10.13 </SPAN>The <CODE>output</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-progress-element"><SPAN class="secno">4.10.14 </SPAN>The <CODE>progress</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-meter-element"><SPAN class="secno">4.10.15 </SPAN>The <CODE>meter</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#association-of-controls-and-forms"><SPAN class="secno">4.10.16 </SPAN>Association of controls and forms</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attributes-common-to-form-controls"><SPAN class="secno">4.10.17 </SPAN>Attributes common to form controls</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#naming-form-controls"><SPAN class="secno">4.10.17.1 </SPAN>Naming form controls</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#enabling-and-disabling-form-controls"><SPAN class="secno">4.10.17.2 </SPAN>Enabling and disabling form controls</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-form-control-s-value"><SPAN class="secno">4.10.17.3 </SPAN>A form control's value</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#autofocusing-a-form-control"><SPAN class="secno">4.10.17.4 </SPAN>Autofocusing a form control</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#limiting-user-input-length"><SPAN class="secno">4.10.17.5 </SPAN>Limiting user input length</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#form-submission-0"><SPAN class="secno">4.10.17.6 </SPAN>Form submission</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#constraints"><SPAN class="secno">4.10.18 </SPAN>Constraints</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#definitions"><SPAN class="secno">4.10.18.1 </SPAN>Definitions</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#constraint-validation"><SPAN class="secno">4.10.18.2 </SPAN>Constraint validation</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-constraint-validation-api"><SPAN class="secno">4.10.18.3 </SPAN>The constraint validation API</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-0"><SPAN class="secno">4.10.18.4 </SPAN>Security</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#form-submission"><SPAN class="secno">4.10.19 </SPAN>Form submission</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction-0"><SPAN class="secno">4.10.19.1 </SPAN>Introduction</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#implicit-submission"><SPAN class="secno">4.10.19.2 </SPAN>Implicit submission</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#form-submission-algorithm"><SPAN class="secno">4.10.19.3 </SPAN>Form submission algorithm</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#url-encoded-form-data"><SPAN class="secno">4.10.19.4 </SPAN>URL-encoded form data</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#multipart-form-data"><SPAN class="secno">4.10.19.5 </SPAN>Multipart form data</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#plain-text-form-data"><SPAN class="secno">4.10.19.6 </SPAN>Plain text form data</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#resetting-a-form"><SPAN class="secno">4.10.20 </SPAN>Resetting a form</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#event-dispatch"><SPAN class="secno">4.10.21 </SPAN>Event dispatch</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#interactive-elements"><SPAN class="secno">4.11 </SPAN>Interactive elements</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-details-element"><SPAN class="secno">4.11.1 </SPAN>The <CODE>details</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-command"><SPAN class="secno">4.11.2 </SPAN>The <CODE>command</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#menus"><SPAN class="secno">4.11.3 </SPAN>The <CODE>menu</CODE> element</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#menus-intro"><SPAN class="secno">4.11.3.1 </SPAN>Introduction</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#building-menus-and-toolbars"><SPAN class="secno">4.11.3.2 </SPAN>Building menus and toolbars</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#context-menus"><SPAN class="secno">4.11.3.3 </SPAN>Context menus</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#toolbars"><SPAN class="secno">4.11.3.4 </SPAN>Toolbars</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#commands"><SPAN class="secno">4.11.4 </SPAN>Commands</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-a-element-to-define-a-command"><SPAN class="secno">4.11.4.1 </SPAN>Using the <CODE>a</CODE> element to define a command</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-button-element-to-define-a-command"><SPAN class="secno">4.11.4.2 </SPAN>Using the <CODE>button</CODE> element to define a command</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-input-element-to-define-a-command"><SPAN class="secno">4.11.4.3 </SPAN>Using the <CODE>input</CODE> element to define a command</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-option-element-to-define-a-command"><SPAN class="secno">4.11.4.4 </SPAN>Using the <CODE>option</CODE> element to define a command</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-command-element-to-define-a-command"><SPAN class="secno">4.11.4.5 </SPAN>Using the <CODE>command</CODE> element to define
  a command</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-accesskey-attribute-on-a-label-element-to-define-a-command"><SPAN class="secno">4.11.4.6 </SPAN>Using the <CODE title="attr-accesskey">accesskey</CODE> attribute on a <CODE>label</CODE> element to define a command</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-accesskey-attribute-on-a-legend-element-to-define-a-command"><SPAN class="secno">4.11.4.7 </SPAN>Using the <CODE title="attr-accesskey">accesskey</CODE> attribute on a <CODE>legend</CODE> element to define a command</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#using-the-accesskey-attribute-to-define-a-command-on-other-elements"><SPAN class="secno">4.11.4.8 </SPAN>Using the <CODE title="attr-accesskey">accesskey</CODE> attribute to define a command on other elements</A></LI></OL></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#common-idioms-without-dedicated-elements"><SPAN class="secno">4.12 </SPAN>Common idioms without dedicated elements</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#tag-clouds"><SPAN class="secno">4.12.1 </SPAN>Tag clouds</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#conversations"><SPAN class="secno">4.12.2 </SPAN>Conversations</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#footnotes"><SPAN class="secno">4.12.3 </SPAN>Footnotes</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#matching-html-elements-using-selectors"><SPAN class="secno">4.13 </SPAN>Matching HTML elements using selectors</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#selectors"><SPAN class="secno">4.13.1 </SPAN>Case-sensitivity</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#pseudo-classes"><SPAN class="secno">4.13.2 </SPAN>Pseudo-classes</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#converting-html-to-other-formats"><SPAN class="secno">4.14 </SPAN>Converting HTML to other formats</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#atom"><SPAN class="secno">4.14.1 </SPAN>Atom</A></LI></OL></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#browsers"><SPAN class="secno">5 </SPAN>Web browsers</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#windows"><SPAN class="secno">5.1 </SPAN>Browsing contexts</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#nested-browsing-contexts"><SPAN class="secno">5.1.1 </SPAN>Nested browsing contexts</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#navigating-nested-browsing-contexts-in-the-dom"><SPAN class="secno">5.1.1.1 </SPAN>Navigating nested browsing contexts in the DOM</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#auxiliary-browsing-contexts"><SPAN class="secno">5.1.2 </SPAN>Auxiliary browsing contexts</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#navigating-auxiliary-browsing-contexts-in-the-dom"><SPAN class="secno">5.1.2.1 </SPAN>Navigating auxiliary browsing contexts in the DOM</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#secondary-browsing-contexts"><SPAN class="secno">5.1.3 </SPAN>Secondary browsing contexts</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-1"><SPAN class="secno">5.1.4 </SPAN>Security</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#groupings-of-browsing-contexts"><SPAN class="secno">5.1.5 </SPAN>Groupings of browsing contexts</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context-names"><SPAN class="secno">5.1.6 </SPAN>Browsing context names</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-windowproxy-object"><SPAN class="secno">5.2 </SPAN>The <CODE>WindowProxy</CODE> object</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-window-object"><SPAN class="secno">5.3 </SPAN>The <CODE>Window</CODE> object</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-2"><SPAN class="secno">5.3.1 </SPAN>Security</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#apis-for-creating-and-navigating-browsing-contexts-by-name"><SPAN class="secno">5.3.2 </SPAN>APIs for creating and navigating browsing contexts by name</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#accessing-other-browsing-contexts"><SPAN class="secno">5.3.3 </SPAN>Accessing other browsing contexts</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#named-access-on-the-window-object"><SPAN class="secno">5.3.4 </SPAN>Named access on the <CODE>Window</CODE> object</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#garbage-collection-and-browsing-contexts"><SPAN class="secno">5.3.5 </SPAN>Garbage collection and browsing contexts</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#browser-interface-elements"><SPAN class="secno">5.3.6 </SPAN>Browser interface elements</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#origin-0"><SPAN class="secno">5.4 </SPAN>Origin</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#relaxing-the-same-origin-restriction"><SPAN class="secno">5.4.1 </SPAN>Relaxing the same-origin restriction</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scripting"><SPAN class="secno">5.5 </SPAN>Scripting</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction-1"><SPAN class="secno">5.5.1 </SPAN>Introduction</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#enabling-and-disabling-scripting"><SPAN class="secno">5.5.2 </SPAN>Enabling and disabling scripting</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#processing-model-1"><SPAN class="secno">5.5.3 </SPAN>Processing model</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#definitions-0"><SPAN class="secno">5.5.3.1 </SPAN>Definitions</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#calling-scripts"><SPAN class="secno">5.5.3.2 </SPAN>Calling scripts</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#creating-scripts"><SPAN class="secno">5.5.3.3 </SPAN>Creating scripts</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#killing-scripts"><SPAN class="secno">5.5.3.4 </SPAN>Killing scripts</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#event-loops"><SPAN class="secno">5.5.4 </SPAN>Event loops</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#definitions-1"><SPAN class="secno">5.5.4.1 </SPAN>Definitions</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#processing-model-2"><SPAN class="secno">5.5.4.2 </SPAN>Processing model</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#generic-task-sources"><SPAN class="secno">5.5.4.3 </SPAN>Generic task sources</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#javascript-protocol"><SPAN class="secno">5.5.5 </SPAN>The <CODE title="">javascript:</CODE> protocol</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#events"><SPAN class="secno">5.5.6 </SPAN>Events</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#event-handler-attributes"><SPAN class="secno">5.5.6.1 </SPAN>Event handlers</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#event-handlers-on-elements-document-objects-and-window-objects"><SPAN class="secno">5.5.6.2 </SPAN>Event handlers on elements, <CODE>Document</CODE> objects, and <CODE>Window</CODE> objects</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#event-firing"><SPAN class="secno">5.5.6.3 </SPAN>Event firing</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#events-and-the-window-object"><SPAN class="secno">5.5.6.4 </SPAN>Events and the <CODE>Window</CODE> object</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#runtime-script-errors"><SPAN class="secno">5.5.6.5 </SPAN>Runtime script errors</A></LI></OL></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#timers"><SPAN class="secno">5.6 </SPAN>Timers</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#user-prompts"><SPAN class="secno">5.7 </SPAN>User prompts</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#simple-dialogs"><SPAN class="secno">5.7.1 </SPAN>Simple dialogs</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#printing"><SPAN class="secno">5.7.2 </SPAN>Printing</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dialogs-implemented-using-separate-documents"><SPAN class="secno">5.7.3 </SPAN>Dialogs implemented using separate documents</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#system-state-and-capabilities"><SPAN class="secno">5.8 </SPAN>System state and capabilities</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#client-identification"><SPAN class="secno">5.8.1 </SPAN>Client identification</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#custom-handlers"><SPAN class="secno">5.8.2 </SPAN>Custom scheme and content handlers</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-and-privacy"><SPAN class="secno">5.8.2.1 </SPAN>Security and privacy</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#sample-handler-impl"><SPAN class="secno">5.8.2.2 </SPAN>Sample user interface</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#manually-releasing-the-storage-mutex"><SPAN class="secno">5.8.3 </SPAN>Manually releasing the storage mutex</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#offline"><SPAN class="secno">5.9 </SPAN>Offline Web applications</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction-2"><SPAN class="secno">5.9.1 </SPAN>Introduction</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#appcacheevents"><SPAN class="secno">5.9.1.1 </SPAN>Event summary</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#appcache"><SPAN class="secno">5.9.2 </SPAN>Application caches</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#manifests"><SPAN class="secno">5.9.3 </SPAN>The cache manifest syntax</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#a-sample-manifest"><SPAN class="secno">5.9.3.1 </SPAN>A sample manifest</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#writing-cache-manifests"><SPAN class="secno">5.9.3.2 </SPAN>Writing cache manifests</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-cache-manifests"><SPAN class="secno">5.9.3.3 </SPAN>Parsing cache manifests</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#downloading-or-updating-an-application-cache"><SPAN class="secno">5.9.4 </SPAN>Downloading or updating an application cache</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-application-cache-selection-algorithm"><SPAN class="secno">5.9.5 </SPAN>The application cache selection algorithm</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#changesToNetworkingModel"><SPAN class="secno">5.9.6 </SPAN>Changes to the networking model</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#expiring-application-caches"><SPAN class="secno">5.9.7 </SPAN>Expiring application caches</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#application-cache-api"><SPAN class="secno">5.9.8 </SPAN>Application cache API</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#browser-state"><SPAN class="secno">5.9.9 </SPAN>Browser state</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#history"><SPAN class="secno">5.10 </SPAN>Session history and navigation</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-session-history-of-browsing-contexts"><SPAN class="secno">5.10.1 </SPAN>The session history of browsing contexts</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-history-interface"><SPAN class="secno">5.10.2 </SPAN>The <CODE>History</CODE> interface</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#activating-state-object-entries"><SPAN class="secno">5.10.3 </SPAN>Activating state object entries</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-location-interface"><SPAN class="secno">5.10.4 </SPAN>The <CODE>Location</CODE> interface</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-3"><SPAN class="secno">5.10.4.1 </SPAN>Security</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#history-notes"><SPAN class="secno">5.10.5 </SPAN>Implementation notes for session history</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#browsing-the-web"><SPAN class="secno">5.11 </SPAN>Browsing the Web</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#navigating-across-documents"><SPAN class="secno">5.11.1 </SPAN>Navigating across documents</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#read-html"><SPAN class="secno">5.11.2 </SPAN>Page load processing model for HTML files</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#read-xml"><SPAN class="secno">5.11.3 </SPAN>Page load processing model for XML files</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#read-text"><SPAN class="secno">5.11.4 </SPAN>Page load processing model for text files</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#read-image"><SPAN class="secno">5.11.5 </SPAN>Page load processing model for images</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#read-plugin"><SPAN class="secno">5.11.6 </SPAN>Page load processing model for content that uses plugins</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#read-ua-inline"><SPAN class="secno">5.11.7 </SPAN>Page load processing model for inline content that doesn't have a DOM</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scroll-to-fragid"><SPAN class="secno">5.11.8 </SPAN>Navigating to a fragment identifier</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#history-traversal"><SPAN class="secno">5.11.9 </SPAN>History traversal</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#unloading-documents"><SPAN class="secno">5.11.10 </SPAN>Unloading documents</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#event-definition"><SPAN class="secno">5.11.10.1 </SPAN>Event definition</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#aborting-a-document-load"><SPAN class="secno">5.11.11 </SPAN>Aborting a document load</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#links"><SPAN class="secno">5.12 </SPAN>Links</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink-elements"><SPAN class="secno">5.12.1 </SPAN>Hyperlink elements</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#following-hyperlinks"><SPAN class="secno">5.12.2 </SPAN>Following hyperlinks</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink-auditing"><SPAN class="secno">5.12.2.1 </SPAN>Hyperlink auditing</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#linkTypes"><SPAN class="secno">5.12.3 </SPAN>Link types</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-alternate"><SPAN class="secno">5.12.3.1 </SPAN>Link type "<CODE>alternate</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-archives"><SPAN class="secno">5.12.3.2 </SPAN>Link type "<CODE>archives</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-author"><SPAN class="secno">5.12.3.3 </SPAN>Link type "<CODE>author</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-bookmark"><SPAN class="secno">5.12.3.4 </SPAN>Link type "<CODE>bookmark</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-external"><SPAN class="secno">5.12.3.5 </SPAN>Link type "<CODE>external</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-help"><SPAN class="secno">5.12.3.6 </SPAN>Link type "<CODE>help</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rel-icon"><SPAN class="secno">5.12.3.7 </SPAN>Link type "<CODE>icon</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-license"><SPAN class="secno">5.12.3.8 </SPAN>Link type "<CODE>license</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-nofollow"><SPAN class="secno">5.12.3.9 </SPAN>Link type "<CODE>nofollow</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-noreferrer"><SPAN class="secno">5.12.3.10 </SPAN>Link type "<CODE>noreferrer</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-pingback"><SPAN class="secno">5.12.3.11 </SPAN>Link type "<CODE>pingback</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-prefetch"><SPAN class="secno">5.12.3.12 </SPAN>Link type "<CODE>prefetch</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-search"><SPAN class="secno">5.12.3.13 </SPAN>Link type "<CODE>search</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-stylesheet"><SPAN class="secno">5.12.3.14 </SPAN>Link type "<CODE>stylesheet</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-sidebar"><SPAN class="secno">5.12.3.15 </SPAN>Link type "<CODE>sidebar</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-tag"><SPAN class="secno">5.12.3.16 </SPAN>Link type "<CODE>tag</CODE>"</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#hierarchical-link-types"><SPAN class="secno">5.12.3.17 </SPAN>Hierarchical link types</A>
        <OL>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-index"><SPAN class="secno">5.12.3.17.1 </SPAN>Link type "<CODE>index</CODE>"</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-up"><SPAN class="secno">5.12.3.17.2 </SPAN>Link type "<CODE>up</CODE>"</A></LI></OL></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#sequential-link-types"><SPAN class="secno">5.12.3.18 </SPAN>Sequential link types</A>
        <OL>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-first"><SPAN class="secno">5.12.3.18.1 </SPAN>Link type "<CODE>first</CODE>"</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-last"><SPAN class="secno">5.12.3.18.2 </SPAN>Link type "<CODE>last</CODE>"</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-next"><SPAN class="secno">5.12.3.18.3 </SPAN>Link type "<CODE>next</CODE>"</A></LI>
         <LI><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-prev"><SPAN class="secno">5.12.3.18.4 </SPAN>Link type "<CODE>prev</CODE>"</A></LI></OL></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#other-link-types"><SPAN class="secno">5.12.3.19 </SPAN>Other link types</A></LI></OL></LI></OL></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#editing"><SPAN class="secno">6 </SPAN>User Interaction</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-hidden-attribute"><SPAN class="secno">6.1 </SPAN>The <CODE>hidden</CODE> attribute</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#activation"><SPAN class="secno">6.2 </SPAN>Activation</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scrolling-elements-into-view"><SPAN class="secno">6.3 </SPAN>Scrolling elements into view</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#focus"><SPAN class="secno">6.4 </SPAN>Focus</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#sequential-focus-navigation"><SPAN class="secno">6.4.1 </SPAN>Sequential focus navigation</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#focus-management"><SPAN class="secno">6.4.2 </SPAN>Focus management</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#document-level-focus-apis"><SPAN class="secno">6.4.3 </SPAN>Document-level focus APIs</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#element-level-focus-apis"><SPAN class="secno">6.4.4 </SPAN>Element-level focus APIs</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-accesskey-attribute"><SPAN class="secno">6.5 </SPAN>The <CODE>accesskey</CODE> attribute</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#selection"><SPAN class="secno">6.6 </SPAN>The text selection APIs</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#documentSelection"><SPAN class="secno">6.6.1 </SPAN>APIs for the browsing context selection</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#textFieldSelection"><SPAN class="secno">6.6.2 </SPAN>APIs for the text field selections</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#contenteditable"><SPAN class="secno">6.7 </SPAN>The <CODE title="attr-contenteditable">contenteditable</CODE> attribute</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#user-editing-actions"><SPAN class="secno">6.7.1 </SPAN>User editing actions</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#making-entire-documents-editable"><SPAN class="secno">6.7.2 </SPAN>Making entire documents editable</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#spelling-and-grammar-checking"><SPAN class="secno">6.8 </SPAN>Spelling and grammar checking</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dnd"><SPAN class="secno">6.9 </SPAN>Drag and drop</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction-3"><SPAN class="secno">6.9.1 </SPAN>Introduction</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-dragevent-and-datatransfer-interfaces"><SPAN class="secno">6.9.2 </SPAN>The <CODE>DragEvent</CODE> and <CODE>DataTransfer</CODE> interfaces</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#dndevents"><SPAN class="secno">6.9.3 </SPAN>Events fired during a drag-and-drop action</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#drag-and-drop-processing-model"><SPAN class="secno">6.9.4 </SPAN>Drag-and-drop processing model</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#when-the-drag-and-drop-operation-starts-or-ends-in-another-document"><SPAN class="secno">6.9.4.1 </SPAN>When the drag-and-drop operation starts or ends in another
  document</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#when-the-drag-and-drop-operation-starts-or-ends-in-another-application"><SPAN class="secno">6.9.4.2 </SPAN>When the drag-and-drop operation starts or ends in another
  application</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-draggable-attribute"><SPAN class="secno">6.9.5 </SPAN>The <CODE>draggable</CODE> attribute</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#copy-and-paste"><SPAN class="secno">6.9.6 </SPAN>Copy and paste</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#copy-to-clipboard"><SPAN class="secno">6.9.6.1 </SPAN>Copy to clipboard</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#cut-to-clipboard"><SPAN class="secno">6.9.6.2 </SPAN>Cut to clipboard</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#paste-from-clipboard"><SPAN class="secno">6.9.6.3 </SPAN>Paste from clipboard</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#paste-from-selection"><SPAN class="secno">6.9.6.4 </SPAN>Paste from selection</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#security-risks-in-the-drag-and-drop-model"><SPAN class="secno">6.9.7 </SPAN>Security risks in the drag-and-drop model</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#undo"><SPAN class="secno">6.10 </SPAN>Undo history</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#definitions-2"><SPAN class="secno">6.10.1 </SPAN>Definitions</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-undomanager-interface"><SPAN class="secno">6.10.2 </SPAN>The <CODE>UndoManager</CODE> interface</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#undo:-moving-back-in-the-undo-transaction-history"><SPAN class="secno">6.10.3 </SPAN>Undo: moving back in the undo transaction history</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#redo:-moving-forward-in-the-undo-transaction-history"><SPAN class="secno">6.10.4 </SPAN>Redo: moving forward in the undo transaction history</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-undomanagerevent-interface-and-the-undo-and-redo-events"><SPAN class="secno">6.10.5 </SPAN>The <CODE>UndoManagerEvent</CODE> interface and the <CODE title="event-undo">undo</CODE> and <CODE title="event-redo">redo</CODE> events</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#implementation-notes"><SPAN class="secno">6.10.6 </SPAN>Implementation notes</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#editing-apis"><SPAN class="secno">6.11 </SPAN>Editing APIs</A></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#syntax"><SPAN class="secno">7 </SPAN>The HTML syntax</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#writing"><SPAN class="secno">7.1 </SPAN>Writing HTML documents</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-doctype"><SPAN class="secno">7.1.1 </SPAN>The DOCTYPE</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#elements-0"><SPAN class="secno">7.1.2 </SPAN>Elements</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#start-tags"><SPAN class="secno">7.1.2.1 </SPAN>Start tags</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#end-tags"><SPAN class="secno">7.1.2.2 </SPAN>End tags</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attributes"><SPAN class="secno">7.1.2.3 </SPAN>Attributes</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#optional-tags"><SPAN class="secno">7.1.2.4 </SPAN>Optional tags</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#element-restrictions"><SPAN class="secno">7.1.2.5 </SPAN>Restrictions on content models</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#cdata-rcdata-restrictions"><SPAN class="secno">7.1.2.6 </SPAN>Restrictions on the contents of raw text and RCDATA elements</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text"><SPAN class="secno">7.1.3 </SPAN>Text</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#newlines"><SPAN class="secno">7.1.3.1 </SPAN>Newlines</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#character-references"><SPAN class="secno">7.1.4 </SPAN>Character references</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#cdata-sections"><SPAN class="secno">7.1.5 </SPAN>CDATA sections</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comments"><SPAN class="secno">7.1.6 </SPAN>Comments</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing"><SPAN class="secno">7.2 </SPAN>Parsing HTML documents</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#overview-of-the-parsing-model"><SPAN class="secno">7.2.1 </SPAN>Overview of the parsing model</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream"><SPAN class="secno">7.2.2 </SPAN>The input stream</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#determining-the-character-encoding"><SPAN class="secno">7.2.2.1 </SPAN>Determining the character encoding</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#character-encodings-0"><SPAN class="secno">7.2.2.2 </SPAN>Character encodings</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#preprocessing-the-input-stream"><SPAN class="secno">7.2.2.3 </SPAN>Preprocessing the input stream</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#changing-the-encoding-while-parsing"><SPAN class="secno">7.2.2.4 </SPAN>Changing the encoding while parsing</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parse-state"><SPAN class="secno">7.2.3 </SPAN>Parse state</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-insertion-mode"><SPAN class="secno">7.2.3.1 </SPAN>The insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-stack-of-open-elements"><SPAN class="secno">7.2.3.2 </SPAN>The stack of open elements</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-list-of-active-formatting-elements"><SPAN class="secno">7.2.3.3 </SPAN>The list of active formatting elements</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-element-pointers"><SPAN class="secno">7.2.3.4 </SPAN>The element pointers</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#other-parsing-state-flags"><SPAN class="secno">7.2.3.5 </SPAN>Other parsing state flags</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#tokenization"><SPAN class="secno">7.2.4 </SPAN>Tokenization</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#data-state"><SPAN class="secno">7.2.4.1 </SPAN>Data state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#character-reference-in-data-state"><SPAN class="secno">7.2.4.2 </SPAN>Character reference in data state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rcdata-state"><SPAN class="secno">7.2.4.3 </SPAN>RCDATA state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#character-reference-in-rcdata-state"><SPAN class="secno">7.2.4.4 </SPAN>Character reference in RCDATA state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rawtext-state"><SPAN class="secno">7.2.4.5 </SPAN>RAWTEXT state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-state"><SPAN class="secno">7.2.4.6 </SPAN>Script data state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#plaintext-state"><SPAN class="secno">7.2.4.7 </SPAN>PLAINTEXT state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#tag-open-state"><SPAN class="secno">7.2.4.8 </SPAN>Tag open state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#close-tag-open-state"><SPAN class="secno">7.2.4.9 </SPAN>Close tag open state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#tag-name-state"><SPAN class="secno">7.2.4.10 </SPAN>Tag name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rcdata-less-than-sign-state"><SPAN class="secno">7.2.4.11 </SPAN>RCDATA less-than sign state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rcdata-end-tag-open-state"><SPAN class="secno">7.2.4.12 </SPAN>RCDATA end tag open state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rcdata-end-tag-name-state"><SPAN class="secno">7.2.4.13 </SPAN>RCDATA end tag name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rawtext-less-than-sign-state"><SPAN class="secno">7.2.4.14 </SPAN>RAWTEXT less-than sign state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rawtext-end-tag-open-state"><SPAN class="secno">7.2.4.15 </SPAN>RAWTEXT end tag open state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rawtext-end-tag-name-state"><SPAN class="secno">7.2.4.16 </SPAN>RAWTEXT end tag name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-less-than-sign-state"><SPAN class="secno">7.2.4.17 </SPAN>Script data less-than sign state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-end-tag-open-state"><SPAN class="secno">7.2.4.18 </SPAN>Script data end tag open state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-end-tag-name-state"><SPAN class="secno">7.2.4.19 </SPAN>Script data end tag name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escape-start-state"><SPAN class="secno">7.2.4.20 </SPAN>Script data escape start state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escape-start-dash-state"><SPAN class="secno">7.2.4.21 </SPAN>Script data escape start dash state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escaped-state"><SPAN class="secno">7.2.4.22 </SPAN>Script data escaped state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escaped-dash-state"><SPAN class="secno">7.2.4.23 </SPAN>Script data escaped dash state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escaped-dash-dash-state"><SPAN class="secno">7.2.4.24 </SPAN>Script data escaped dash dash state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escaped-less-than-sign-state"><SPAN class="secno">7.2.4.25 </SPAN>Script data escaped less-than sign state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escaped-end-tag-open-state"><SPAN class="secno">7.2.4.26 </SPAN>Script data escaped end tag open state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-escaped-end-tag-name-state"><SPAN class="secno">7.2.4.27 </SPAN>Script data escaped end tag name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-double-escape-start-state"><SPAN class="secno">7.2.4.28 </SPAN>Script data double escape start state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-double-escaped-state"><SPAN class="secno">7.2.4.29 </SPAN>Script data double escaped state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-double-escaped-dash-state"><SPAN class="secno">7.2.4.30 </SPAN>Script data double escaped dash state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-double-escaped-dash-dash-state"><SPAN class="secno">7.2.4.31 </SPAN>Script data double escaped dash dash state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-double-escaped-less-than-sign-state"><SPAN class="secno">7.2.4.32 </SPAN>Script data double escaped less-than sign state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#script-data-double-escape-end-state"><SPAN class="secno">7.2.4.33 </SPAN>Script data double escape end state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#before-attribute-name-state"><SPAN class="secno">7.2.4.34 </SPAN>Before attribute name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attribute-name-state"><SPAN class="secno">7.2.4.35 </SPAN>Attribute name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#after-attribute-name-state"><SPAN class="secno">7.2.4.36 </SPAN>After attribute name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#before-attribute-value-state"><SPAN class="secno">7.2.4.37 </SPAN>Before attribute value state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attribute-value-double-quoted-state"><SPAN class="secno">7.2.4.38 </SPAN>Attribute value (double-quoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attribute-value-single-quoted-state"><SPAN class="secno">7.2.4.39 </SPAN>Attribute value (single-quoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attribute-value-unquoted-state"><SPAN class="secno">7.2.4.40 </SPAN>Attribute value (unquoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#character-reference-in-attribute-value-state"><SPAN class="secno">7.2.4.41 </SPAN>Character reference in attribute value state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#after-attribute-value-quoted-state"><SPAN class="secno">7.2.4.42 </SPAN>After attribute value (quoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#self-closing-start-tag-state"><SPAN class="secno">7.2.4.43 </SPAN>Self-closing start tag state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#bogus-comment-state"><SPAN class="secno">7.2.4.44 </SPAN>Bogus comment state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#markup-declaration-open-state"><SPAN class="secno">7.2.4.45 </SPAN>Markup declaration open state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comment-start-state"><SPAN class="secno">7.2.4.46 </SPAN>Comment start state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comment-start-dash-state"><SPAN class="secno">7.2.4.47 </SPAN>Comment start dash state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comment-state"><SPAN class="secno">7.2.4.48 </SPAN>Comment state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comment-end-dash-state"><SPAN class="secno">7.2.4.49 </SPAN>Comment end dash state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comment-end-state"><SPAN class="secno">7.2.4.50 </SPAN>Comment end state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comment-end-bang-state"><SPAN class="secno">7.2.4.51 </SPAN>Comment end bang state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#comment-end-space-state"><SPAN class="secno">7.2.4.52 </SPAN>Comment end space state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#doctype-state"><SPAN class="secno">7.2.4.53 </SPAN>DOCTYPE state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#before-doctype-name-state"><SPAN class="secno">7.2.4.54 </SPAN>Before DOCTYPE name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#doctype-name-state"><SPAN class="secno">7.2.4.55 </SPAN>DOCTYPE name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#after-doctype-name-state"><SPAN class="secno">7.2.4.56 </SPAN>After DOCTYPE name state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#after-doctype-public-keyword-state"><SPAN class="secno">7.2.4.57 </SPAN>After DOCTYPE public keyword state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#before-doctype-public-identifier-state"><SPAN class="secno">7.2.4.58 </SPAN>Before DOCTYPE public identifier state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#doctype-public-identifier-double-quoted-state"><SPAN class="secno">7.2.4.59 </SPAN>DOCTYPE public identifier (double-quoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#doctype-public-identifier-single-quoted-state"><SPAN class="secno">7.2.4.60 </SPAN>DOCTYPE public identifier (single-quoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#after-doctype-public-identifier-state"><SPAN class="secno">7.2.4.61 </SPAN>After DOCTYPE public identifier state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#between-doctype-public-and-system-identifiers-state"><SPAN class="secno">7.2.4.62 </SPAN>Between DOCTYPE public and system identifiers state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#after-doctype-system-keyword-state"><SPAN class="secno">7.2.4.63 </SPAN>After DOCTYPE system keyword state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#before-doctype-system-identifier-state"><SPAN class="secno">7.2.4.64 </SPAN>Before DOCTYPE system identifier state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#doctype-system-identifier-double-quoted-state"><SPAN class="secno">7.2.4.65 </SPAN>DOCTYPE system identifier (double-quoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#doctype-system-identifier-single-quoted-state"><SPAN class="secno">7.2.4.66 </SPAN>DOCTYPE system identifier (single-quoted) state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#after-doctype-system-identifier-state"><SPAN class="secno">7.2.4.67 </SPAN>After DOCTYPE system identifier state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#bogus-doctype-state"><SPAN class="secno">7.2.4.68 </SPAN>Bogus DOCTYPE state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#cdata-section-state"><SPAN class="secno">7.2.4.69 </SPAN>CDATA section state</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#tokenizing-character-references"><SPAN class="secno">7.2.4.70 </SPAN>Tokenizing character references</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#tree-construction"><SPAN class="secno">7.2.5 </SPAN>Tree construction</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#creating-and-inserting-elements"><SPAN class="secno">7.2.5.1 </SPAN>Creating and inserting elements</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#closing-elements-that-have-implied-end-tags"><SPAN class="secno">7.2.5.2 </SPAN>Closing elements that have implied end tags</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#foster-parenting"><SPAN class="secno">7.2.5.3 </SPAN>Foster parenting</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-initial-insertion-mode"><SPAN class="secno">7.2.5.4 </SPAN>The "initial" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-before-html-insertion-mode"><SPAN class="secno">7.2.5.5 </SPAN>The "before html" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-before-head-insertion-mode"><SPAN class="secno">7.2.5.6 </SPAN>The "before head" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-inhead"><SPAN class="secno">7.2.5.7 </SPAN>The "in head" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-inheadnoscript"><SPAN class="secno">7.2.5.8 </SPAN>The "in head noscript" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-after-head-insertion-mode"><SPAN class="secno">7.2.5.9 </SPAN>The "after head" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-inbody"><SPAN class="secno">7.2.5.10 </SPAN>The "in body" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-incdata"><SPAN class="secno">7.2.5.11 </SPAN>The "text" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-intable"><SPAN class="secno">7.2.5.12 </SPAN>The "in table" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-intabletext"><SPAN class="secno">7.2.5.13 </SPAN>The "in table text" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-incaption"><SPAN class="secno">7.2.5.14 </SPAN>The "in caption" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-incolgroup"><SPAN class="secno">7.2.5.15 </SPAN>The "in column group" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-intbody"><SPAN class="secno">7.2.5.16 </SPAN>The "in table body" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-intr"><SPAN class="secno">7.2.5.17 </SPAN>The "in row" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-intd"><SPAN class="secno">7.2.5.18 </SPAN>The "in cell" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-inselect"><SPAN class="secno">7.2.5.19 </SPAN>The "in select" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-inselectintable"><SPAN class="secno">7.2.5.20 </SPAN>The "in select in table" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-inforeign"><SPAN class="secno">7.2.5.21 </SPAN>The "in foreign content" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-afterbody"><SPAN class="secno">7.2.5.22 </SPAN>The "after body" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-inframeset"><SPAN class="secno">7.2.5.23 </SPAN>The "in frameset" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-main-afterframeset"><SPAN class="secno">7.2.5.24 </SPAN>The "after frameset" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-after-after-body-insertion-mode"><SPAN class="secno">7.2.5.25 </SPAN>The "after after body" insertion mode</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-after-after-frameset-insertion-mode"><SPAN class="secno">7.2.5.26 </SPAN>The "after after frameset" insertion mode</A></LI></OL></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-end"><SPAN class="secno">7.2.6 </SPAN>The end</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#coercing-an-html-dom-into-an-infoset"><SPAN class="secno">7.2.7 </SPAN>Coercing an HTML DOM into an infoset</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#an-introduction-to-error-handling-and-strange-cases-in-the-parser"><SPAN class="secno">7.2.8 </SPAN>An introduction to error handling and strange cases in the parser</A>
      <OL>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#misnested-tags:-b-i-b-i"><SPAN class="secno">7.2.8.1 </SPAN>Misnested tags: &lt;b&gt;&lt;i&gt;&lt;/b&gt;&lt;/i&gt;</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#misnested-tags:-b-p-b-p"><SPAN class="secno">7.2.8.2 </SPAN>Misnested tags: &lt;b&gt;&lt;p&gt;&lt;/b&gt;&lt;/p&gt;</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#unexpected-markup-in-tables"><SPAN class="secno">7.2.8.3 </SPAN>Unexpected markup in tables</A></LI>
       <LI><A href="http://dev.w3.org/html5/spec/Overview.html#scripts-that-modify-the-page-as-it-is-being-parsed"><SPAN class="secno">7.2.8.4 </SPAN>Scripts that modify the page as it is being parsed</A></LI></OL></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#serializing-html-fragments"><SPAN class="secno">7.3 </SPAN>Serializing HTML fragments</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-html-fragments"><SPAN class="secno">7.4 </SPAN>Parsing HTML fragments</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#named-character-references"><SPAN class="secno">7.5 </SPAN>Named character references</A></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-xhtml-syntax"><SPAN class="secno">8 </SPAN>The XHTML syntax</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#writing-xhtml-documents"><SPAN class="secno">8.1 </SPAN>Writing XHTML documents</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-xhtml-documents"><SPAN class="secno">8.2 </SPAN>Parsing XHTML documents</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#serializing-xhtml-fragments"><SPAN class="secno">8.3 </SPAN>Serializing XHTML fragments</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#parsing-xhtml-fragments"><SPAN class="secno">8.4 </SPAN>Parsing XHTML fragments</A></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#rendering"><SPAN class="secno">9 </SPAN>Rendering</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction-4"><SPAN class="secno">9.1 </SPAN>Introduction</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-css-user-agent-style-sheet-and-presentational-hints"><SPAN class="secno">9.2 </SPAN>The CSS user agent style sheet and presentational hints</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction-5"><SPAN class="secno">9.2.1 </SPAN>Introduction</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#display-types"><SPAN class="secno">9.2.2 </SPAN>Display types</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#margins-and-padding"><SPAN class="secno">9.2.3 </SPAN>Margins and padding</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#alignment"><SPAN class="secno">9.2.4 </SPAN>Alignment</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#fonts-and-colors"><SPAN class="secno">9.2.5 </SPAN>Fonts and colors</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#punctuation-and-decorations"><SPAN class="secno">9.2.6 </SPAN>Punctuation and decorations</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#resetting-rules-for-inherited-properties"><SPAN class="secno">9.2.7 </SPAN>Resetting rules for inherited properties</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-hr-element-0"><SPAN class="secno">9.2.8 </SPAN>The <CODE>hr</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-fieldset-element-0"><SPAN class="secno">9.2.9 </SPAN>The <CODE>fieldset</CODE> element</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#replaced-elements"><SPAN class="secno">9.3 </SPAN>Replaced elements</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content-2"><SPAN class="secno">9.3.1 </SPAN>Embedded content</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#images"><SPAN class="secno">9.3.2 </SPAN>Images</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#attributes-for-embedded-content-and-images"><SPAN class="secno">9.3.3 </SPAN>Attributes for embedded content and images</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#image-maps-0"><SPAN class="secno">9.3.4 </SPAN>Image maps</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#toolbars-0"><SPAN class="secno">9.3.5 </SPAN>Toolbars</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#bindings"><SPAN class="secno">9.4 </SPAN>Bindings</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#introduction-6"><SPAN class="secno">9.4.1 </SPAN>Introduction</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-button-element-0"><SPAN class="secno">9.4.2 </SPAN>The <CODE>button</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-details-element-0"><SPAN class="secno">9.4.3 </SPAN>The <CODE>details</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element-as-a-text-entry-widget"><SPAN class="secno">9.4.4 </SPAN>The <CODE>input</CODE> element as a text entry widget</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element-as-domain-specific-widgets"><SPAN class="secno">9.4.5 </SPAN>The <CODE>input</CODE> element as domain-specific widgets</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element-as-a-range-control"><SPAN class="secno">9.4.6 </SPAN>The <CODE>input</CODE> element as a range control</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element-as-a-color-well"><SPAN class="secno">9.4.7 </SPAN>The <CODE>input</CODE> element as a color well</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element-as-a-check-box-and-radio-button-widgets"><SPAN class="secno">9.4.8 </SPAN>The <CODE>input</CODE> element as a check box and radio button widgets</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element-as-a-file-upload-control"><SPAN class="secno">9.4.9 </SPAN>The <CODE>input</CODE> element as a file upload control</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element-as-a-button"><SPAN class="secno">9.4.10 </SPAN>The <CODE>input</CODE> element as a button</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-marquee-element-0"><SPAN class="secno">9.4.11 </SPAN>The <CODE>marquee</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-meter-element-0"><SPAN class="secno">9.4.12 </SPAN>The <CODE>meter</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-progress-element-0"><SPAN class="secno">9.4.13 </SPAN>The <CODE>progress</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element-0"><SPAN class="secno">9.4.14 </SPAN>The <CODE>select</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-textarea-element-0"><SPAN class="secno">9.4.15 </SPAN>The <CODE>textarea</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-keygen-element-0"><SPAN class="secno">9.4.16 </SPAN>The <CODE>keygen</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-time-element-0"><SPAN class="secno">9.4.17 </SPAN>The <CODE>time</CODE> element</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#frames-and-framesets"><SPAN class="secno">9.5 </SPAN>Frames and framesets</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#interactive-media"><SPAN class="secno">9.6 </SPAN>Interactive media</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#links-forms-and-navigation"><SPAN class="secno">9.6.1 </SPAN>Links, forms, and navigation</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute-0"><SPAN class="secno">9.6.2 </SPAN>The <CODE title="attr-title">title</CODE> attribute</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#editing-hosts"><SPAN class="secno">9.6.3 </SPAN>Editing hosts</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#print-media"><SPAN class="secno">9.7 </SPAN>Print media</A></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#obsolete"><SPAN class="secno">10 </SPAN>Obsolete features</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#obsolete-but-conforming-features"><SPAN class="secno">10.1 </SPAN>Obsolete but conforming features</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#warnings-for-obsolete-but-conforming-features"><SPAN class="secno">10.1.1 </SPAN>Warnings for obsolete but conforming features</A></LI></OL></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#non-conforming-features"><SPAN class="secno">10.2 </SPAN>Non-conforming features</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#requirements-for-implementations"><SPAN class="secno">10.3 </SPAN>Requirements for implementations</A>
    <OL>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element"><SPAN class="secno">10.3.1 </SPAN>The <CODE>applet</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#the-marquee-element"><SPAN class="secno">10.3.2 </SPAN>The <CODE>marquee</CODE> element</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#frames"><SPAN class="secno">10.3.3 </SPAN>Frames</A></LI>
     <LI><A href="http://dev.w3.org/html5/spec/Overview.html#other-elements-attributes-and-apis"><SPAN class="secno">10.3.4 </SPAN>Other elements, attributes and APIs</A></LI></OL></LI></OL></LI>
 <LI><A href="http://dev.w3.org/html5/spec/Overview.html#iana"><SPAN class="secno">11 </SPAN>IANA considerations</A>
  <OL>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-html"><SPAN class="secno">11.1 </SPAN><CODE>text/html</CODE></A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-html-sandboxed"><SPAN class="secno">11.2 </SPAN><CODE>text/html-sandboxed</CODE></A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#application-xhtml-xml"><SPAN class="secno">11.3 </SPAN><CODE>application/xhtml+xml</CODE></A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-cache-manifest"><SPAN class="secno">11.4 </SPAN><CODE>text/cache-manifest</CODE></A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-ping"><SPAN class="secno">11.5 </SPAN><CODE>text/ping</CODE></A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#ping-from"><SPAN class="secno">11.6 </SPAN><CODE>Ping-From</CODE></A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#ping-to"><SPAN class="secno">11.7 </SPAN><CODE>Ping-To</CODE></A></LI></OL></LI>
 <LI><A class="no-num" href="http://dev.w3.org/html5/spec/Overview.html#index">Index</A>
  <OL>
   <LI><A class="no-num" href="http://dev.w3.org/html5/spec/Overview.html#elements-1">Elements</A></LI>
   <LI><A class="no-num" href="http://dev.w3.org/html5/spec/Overview.html#attributes-0">Attributes</A></LI>
   <LI><A class="no-num" href="http://dev.w3.org/html5/spec/Overview.html#interfaces">Interfaces</A></LI>
   <LI><A class="no-num" href="http://dev.w3.org/html5/spec/Overview.html#events-0">Events</A></LI></OL></LI>
 <LI><A class="no-num" href="http://dev.w3.org/html5/spec/Overview.html#references">References</A></LI>
 <LI><A class="no-num" href="http://dev.w3.org/html5/spec/Overview.html#acknowledgements">Acknowledgements</A></LI></OL>
<!--end-toc--><HR><H2 id="introduction"><SPAN class="secno">1 </SPAN>Introduction</H2><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><H3 id="background"><SPAN class="secno">1.1 </SPAN>Background</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>The World Wide Web's markup language has always been HTML. HTML
  was primarily designed as a language for semantically describing
  scientific documents, although its general design and adaptations
  over the years have enabled it to be used to describe a number of
  other types of documents.</P><P>The main area that has not been adequately addressed by HTML is a
  vague subject referred to as Web Applications. This specification
  attempts to rectify this, while at the same time updating the HTML
  specifications to address issues raised in the past few years.</P><H3 id="audience"><SPAN class="secno">1.2 </SPAN>Audience</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>This specification is intended for authors of documents and
  scripts that use the features defined in this specification<SPAN class="impl">, implementors of tools that operate on pages that use
  the features defined in this specification, and individuals wishing
  to establish the correctness of documents or implementations with
  respect to the requirements of this specification</SPAN>.</P><P>This document is probably not suited to readers who do not
  already have at least a passing familiarity with Web technologies,
  as in places it sacrifices clarity for precision, and brevity for
  completeness. More approachable tutorials and authoring guides can
  provide a gentler introduction to the topic.</P><P>In particular, familiarity with the basics of DOM Core and DOM
  Events is necessary for a complete understanding of some of the more
  technical parts of this specification. An understanding of Web IDL,
  HTTP, XML, Unicode, character encodings, JavaScript, and CSS will
  also be helpful in places but is not essential.</P><H3 id="scope"><SPAN class="secno">1.3 </SPAN>Scope</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>This specification is limited to providing a semantic-level
  markup language and associated semantic-level scripting APIs for
  authoring accessible pages on the Web ranging from static documents
  to dynamic applications.</P><P>The scope of this specification does not include providing
  mechanisms for media-specific customization of presentation
  (although default rendering rules for Web browsers are included at
  the end of this specification, and several mechanisms for hooking
  into CSS are provided as part of the language).</P><P>The scope of this specification is not to describe an entire
  operating system. In particular, hardware configuration software,
  image manipulation tools, and applications that users would be
  expected to use with high-end workstations on a daily basis are out
  of scope. In terms of applications, this specification is targeted
  specifically at applications that would be expected to be used by
  users on an occasional basis, or regularly but from disparate
  locations, with low CPU requirements. For instance online purchasing
  systems, searching systems, games (especially multiplayer online
  games), public telephone books or address books, communications
  software (e-mail clients, instant messaging clients, discussion
  software), document editing software, etc.</P><H3 id="history-1"><SPAN class="secno">1.4 </SPAN>History</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>For its first five years (1990-1995), HTML went through a number
  of revisions and experienced a number of extensions, primarily
  hosted first at CERN, and then at the IETF.</P><P>With the creation of the W3C, HTML's development changed venue
  again. A first abortive attempt at extending HTML in 1995 known as
  HTML 3.0 then made way to a more pragmatic approach known as HTML
  3.2, which was completed in 1997. HTML4 followed, reaching
  completion in 1998.</P><P>At this time, the W3C membership decided to stop evolving HTML
  and instead begin work on an XML-based equivalent, called
  XHTML. This effort started with a reformulation of HTML4 in XML,
  known as XHTML 1.0, which added no new features except the new
  serialization, and which was completed in 2000. After XHTML 1.0, the
  W3C's focus turned to making it easier for other working groups to
  extend XHTML, under the banner of XHTML Modularization. In parallel
  with this, the W3C also worked on a new language that was not
  compatible with the earlier HTML and XHTML languages, calling it
  XHTML2.</P><P>Around the time that HTML's evolution was stopped in 1998, parts
  of the API for HTML developed by browser vendors were specified and
  published under the name DOM Level 1 (in 1998) and DOM Level 2 Core
  and DOM Level 2 HTML (starting in 2000 and culminating in
  2003). These efforts then petered out, with some DOM Level 3
  specifications published in 2004 but the working group being closed
  before all the Level 3 drafts were completed.</P><P>In 2003, the publication of XForms, a technology which was
  positioned as the next generation of Web forms, sparked a renewed
  interest in evolving HTML itself, rather than finding replacements
  for it. This interest was borne from the realization that XML's
  deployment as a Web technology was limited to entirely new
  technologies (like RSS and later Atom), rather than as a replacement
  for existing deployed technologies (like HTML).</P><P>A proof of concept to show that it was possible to extend HTML4's
  forms to provide many of the features that XForms 1.0 introduced,
  without requiring browsers to implement rendering engines that were
  incompatible with existing HTML Web pages, was the first result of
  this renewed interest. At this early stage, while the draft was
  already publicly available, and input was already being solicited
  from all sources, the specification was only under Opera Software's
  copyright.</P><P>The idea that HTML's evolution should be reopened was tested at a
  W3C workshop in 2004, where some of the principles that underlie the
  HTML5 work (described below), as well as the aforementioned early
  draft proposal covering just forms-related features, were presented
  to the W3C jointly by Mozilla and Opera. The proposal was rejected
  on the grounds that the proposal conflicted with the previously
  chosen direction for the Web's evolution; the W3C staff and
  membership voted to continue developing XML-based replacements
  instead.</P><P>Shortly thereafter, Apple, Mozilla, and Opera jointly announced
  their intent to continue working on the effort under the umbrella of
  a new venue called the WHATWG. A public mailing list was created,
  and the draft was moved to the WHATWG site. The copyright was
  subsequently amended to be jointly owned by all three vendors, and
  to allow reuse of the specification.</P><P>The WHATWG was based on several core principles, in particular
  that technologies need to be backwards compatible, that
  specifications and implementations need to match even if this means
  changing the specification rather than the implementations, and that
  specifications need to be detailed enough that implementations can
  achieve complete interoperability without reverse-engineering each
  other.</P><P>The latter requirement in particular required that the scope of
  the HTML5 specification include what had previously been specified
  in three separate documents: HTML4, XHTML1, and DOM2 HTML. It also
  meant including significantly more detail than had previously been
  considered the norm.</P><P>In 2006, the W3C indicated an interest to participate in the
  development of HTML5 after all, and in 2007 formed a working group
  chartered to work with the WHATWG on the development of the HTML5
  specification. Apple, Mozilla, and Opera allowed the W3C to publish
  the specification under the W3C copyright, while keeping a version
  with the less restrictive license on the WHATWG site.</P><P>Since then, both groups have been working together.</P><P>A separate document has been published by the W3C HTML working
  group to document the differences between this specification and the
  language described in the HTML4 specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsHTMLDIFF">[HTMLDIFF]</A></P><H3 id="design-notes"><SPAN class="secno">1.5 </SPAN>Design notes</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>It must be admitted that many aspects of HTML appear at first
  glance to be nonsensical and inconsistent.</P><P>HTML, its supporting DOM APIs, as well as many of its supporting
  technologies, have been developed over a period of several decades
  by a wide array of people with different priorities who, in many
  cases, did not know of each other's existence.</P><P>Features have thus arisen from many sources, and have not always
  been designed in especially consistent ways. Furthermore, because of
  the unique characteristics of the Web, implementation bugs have
  often become de-facto, and now de-jure, standards, as content is
  often unintentionally written in ways that rely on them before they
  can be fixed.</P><P>Despite all this, efforts have been made to adhere to certain
  design goals. These are described in the next few subsections.</P><H4 id="serializability-of-script-execution"><SPAN class="secno">1.5.1 </SPAN>Serializability of script execution</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>To avoid exposing Web authors to the complexities of
  multithreading, the HTML and DOM APIs are designed such that no
  script can ever detect the simultaneous execution of other
  scripts. Even with <SPAN title="Worker">workers</SPAN>, the intent
  is that the behavior of implementations can be thought of as
  completely serializing the execution of all scripts in all <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context" title="browsing context">browsing contexts</A>.</P><P class="note">The <CODE title="dom-navigator-yieldForStorageUpdates"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</A></CODE>
  method, in this model, is equivalent to allowing other scripts to
  run while the calling script is blocked.</P><H4 id="compliance-with-other-specifications"><SPAN class="secno">1.5.2 </SPAN>Compliance with other specifications</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>This specification interacts with and relies on a wide variety of
  other specifications. In certain circumstances, unfortunately, the
  desire to be compatible with legacy content has led to this
  specification violating the requirements of these other
  specifications. Whenever this has occurred, the transgressions have
  each been noted as a "<DFN id="willful-violation">willful violation</DFN>".</P><H3 id="html-vs-xhtml"><SPAN class="secno">1.6 </SPAN>HTML vs XHTML</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>This specification defines an abstract language for describing
  documents and applications, and some APIs for interacting with
  in-memory representations of resources that use this language.</P><P>The in-memory representation is known as "DOM HTML", or "the DOM"
  for short. This specification defines version 5 of DOM HTML, known
  as "DOM5 HTML".</P><P>There are various concrete syntaxes that can be used to transmit
  resources that use this abstract language, two of which are defined
  in this specification.</P><P>The first such concrete syntax is the HTML syntax. This is the
  format suggested for most authors. It is compatible with most legacy
  Web browsers. If a document is transmitted with an <A href="http://dev.w3.org/html5/spec/Overview.html#html-mime-type">HTML MIME
  type</A>, such as <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#text-html">text/html</A></CODE>, then it will be
  processed as an HTML document by Web browsers. This specification
  defines version 5 of the HTML syntax, known as "HTML5".</P><P>The second concrete syntax is the XHTML syntax, which is an
  application of XML. When a document is transmitted with an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-mime-type">XML
  MIME type</A>, such as <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#application-xhtml-xml">application/xhtml+xml</A></CODE>, then
  it is treated as an XML document by Web browsers, to be parsed by an
  XML processor. Authors are reminded that the processing for XML and
  HTML differs; in particular, even minor syntax errors will prevent a
  document labeled as XML from being rendered fully, whereas they
  would be ignored in the HTML syntax. This specification defines
  version 5 of the XHTML syntax, known as "XHTML5".</P><P>The DOM, the HTML syntax, and XML cannot all represent the same
  content. For example, namespaces cannot be represented using the
  HTML syntax, but they are supported in the DOM and in XML.
  Similarly, documents that use the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-noscript-element">noscript</A></CODE> feature can
  be represented using the HTML syntax, but cannot be represented with
  the DOM or in XML. Comments that contain the string "<CODE title="">--&gt;</CODE>" can be represented in the DOM but not in the
  HTML syntax or in XML.</P><H3 id="structure-of-this-specification"><SPAN class="secno">1.7 </SPAN>Structure of this specification</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>This specification is divided into the following major
  sections:</P><DL><DT><A href="http://dev.w3.org/html5/spec/Overview.html#infrastructure">Common Infrastructure</A></DT>

   <DD>The conformance classes, algorithms, definitions, and the
   common underpinnings of the rest of the specification.</DD>


   <DT><A href="http://dev.w3.org/html5/spec/Overview.html#dom">Semantics, structure, and APIs of HTML documents</A></DT>

   <DD>Documents are built from elements. These elements form a tree
   using the DOM. This section defines the features of this DOM, as
   well as introducing the features common to all elements, and the
   concepts used in defining elements.</DD>


   <DT><A href="http://dev.w3.org/html5/spec/Overview.html#semantics">Elements</A></DT>

   <DD>Each element has a predefined meaning, which is explained in
   this section. Rules for authors on how to use the element<SPAN class="impl">, along with user agent requirements for how to handle
   each element,</SPAN> are also given.</DD>


   <DT><A href="http://dev.w3.org/html5/spec/Overview.html#browsers">Web Browsers</A></DT>

   <DD>HTML documents do not exist in a vacuum — this section
   defines many of the features that affect environments that deal
   with multiple pages, links between pages, and running scripts.</DD>


   <DT><A href="http://dev.w3.org/html5/spec/Overview.html#editing">User Interaction</A></DT>

   <DD>HTML documents can provide a number of mechanisms for users to
   interact with and modify content, which are described in this
   section.</DD>




   <DT><A href="http://dev.w3.org/html5/spec/Overview.html#syntax">The HTML Syntax</A></DT>
   <DT><A href="http://dev.w3.org/html5/spec/Overview.html#xhtml">The XHTML Syntax</A></DT>

   <DD>All of these features would be for naught if they couldn't be
   represented in a serialized form and sent to other people, and so
   these sections define the syntaxes of HTML, along with rules for
   how to parse content using those syntaxes.</DD>


  </DL><P>There are also some appendices, defining <A href="http://dev.w3.org/html5/spec/Overview.html#rendering">rendering rules</A> for Web browsers and listing
  <A href="http://dev.w3.org/html5/spec/Overview.html#obsolete">obsolete features</A> and <A href="http://dev.w3.org/html5/spec/Overview.html#iana">IANA
  considerations</A>.</P><H4 id="how-to-read-this-specification"><SPAN class="secno">1.7.1 </SPAN>How to read this specification</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>This specification should be read like all other specifications.
  First, it should be read cover-to-cover, multiple times. Then, it
  should be read backwards at least once. Then it should be read by
  picking random sections from the contents list and following all the
  cross-references.</P><H4 id="typographic-conventions"><SPAN class="secno">1.7.2 </SPAN>Typographic conventions</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>This is a definition, requirement, or explanation.</P><P class="note">This is a note.</P><P class="example">This is an example.</P><P class="XXX">This is an open issue.</P><P class="warning">This is a warning.</P><PRE class="idl extract">interface <DFN title="">Example</DFN> {
  // this is an IDL definition
};</PRE><DL class="domintro"><DT><VAR title="">variable</VAR> = <VAR title="">object</VAR> . <CODE title="">method</CODE>( [ <VAR title="">optionalArgument</VAR> ] )</DT>

   <DD>

    <P>This is a note to authors describing the usage of an interface.</P>

   </DD>

  </DL><PRE class="css">/* this is a CSS fragment */</PRE><P>The defining instance of a term is marked up like <DFN id="x-this" title="x-this">this</DFN>. Uses of that term are marked up like
  <A href="http://dev.w3.org/html5/spec/Overview.html#x-this" title="x-this">this</A> or like <I title="x-this"><A href="http://dev.w3.org/html5/spec/Overview.html#x-this">this</A></I>.</P><P>The defining instance of an element, attribute, or API is marked
  up like <DFN id="x-that" title="x-that"><CODE>this</CODE></DFN>. References to
  that element, attribute, or API are marked up like <CODE title="x-that"><A href="http://dev.w3.org/html5/spec/Overview.html#x-that">this</A></CODE>.</P><P>Other code fragments are marked up <CODE title="">like
  this</CODE>.</P><P>Variables are marked up like <VAR title="">this</VAR>.</P><P class="impl">This is an implementation requirement.</P><H3 id="a-quick-introduction-to-html"><SPAN class="secno">1.8 </SPAN>A quick introduction to HTML</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>A basic HTML document looks like this:</P><PRE id="intro-early-example">&lt;!DOCTYPE html&gt;
&lt;html&gt;
 &lt;head&gt;
  &lt;title&gt;Sample page&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;h1&gt;Sample page&lt;/h1&gt;
  &lt;p&gt;This is a &lt;a href="demo.html"&gt;simple&lt;/a&gt; sample.&lt;/p&gt;
  &lt;!-- this is a comment --&gt;
 &lt;/body&gt;
&lt;/html&gt;</PRE><P>HTML documents consist of a tree of elements and text. Each
  element is denoted in the source by a <A href="http://dev.w3.org/html5/spec/Overview.html#syntax-start-tag" title="syntax-start-tag">start tag</A>, such as "<CODE title="">&lt;body&gt;</CODE>", and an <A href="http://dev.w3.org/html5/spec/Overview.html#syntax-end-tag" title="syntax-end-tag">end
  tag</A>, such as "<CODE title="">&lt;/body&gt;</CODE>". (Certain
  start tags and end tags can in certain cases be <A href="http://dev.w3.org/html5/spec/Overview.html#syntax-tag-omission" title="syntax-tag-omission">omitted</A> and are implied by other
  tags.)</P><P>Tags have to be nested such that elements are all completely
  within each other, without overlapping:</P><PRE class="bad">&lt;p&gt;This is &lt;em&gt;very &lt;strong&gt;wrong&lt;/em&gt;!&lt;/strong&gt;&lt;/p&gt;</PRE><PRE>&lt;p&gt;This &lt;em&gt;is &lt;strong&gt;correct&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;</PRE><P>This specification defines a set of elements that can be used in
  HTML, along with rules about the ways in which the elements can be
  nested.</P><P>Elements can have attributes, which control how the elements
  work. In the example below, there is a <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink">hyperlink</A>,
  formed using the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> element and its <CODE title="attr-hyperlink-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-href">href</A></CODE> attribute:</P><PRE>&lt;a href="demo.html"&gt;simple&lt;/a&gt;</PRE><P><A href="http://dev.w3.org/html5/spec/Overview.html#syntax-attributes" title="syntax-attributes">Attributes</A> are placed
  inside the start tag, and consist of a <A href="http://dev.w3.org/html5/spec/Overview.html#syntax-attribute-name" title="syntax-attribute-name">name</A> and a <A href="http://dev.w3.org/html5/spec/Overview.html#syntax-attribute-value" title="syntax-attribute-value">value</A>, separated by an "<CODE title="">=</CODE>" character. The attribute value can be left <A href="http://dev.w3.org/html5/spec/Overview.html#unquoted">unquoted</A> if it doesn't contain spaces or any of
  <CODE title="">"</CODE> <CODE title="">'</CODE> <CODE title="">`</CODE> <CODE title="">=</CODE> <CODE title="">&lt;</CODE>
  or <CODE title="">&gt;</CODE>. Otherwise, it has to be quoted using
  either single or double quotes. The value, along with the "<CODE title="">=</CODE>" character, can be omitted altogether if the value
  is the empty string.</P><PRE>&lt;!-- empty attributes --&gt;
&lt;input name=address disabled&gt;
&lt;input name=address disabled=""&gt;

&lt;!-- attributes with a value --&gt;
&lt;input name=address maxlength=200&gt;
&lt;input name=address maxlength='200'&gt;
&lt;input name=address maxlength="200"&gt;</PRE><P>HTML user agents (e.g. Web browsers) then <I>parse</I> this
  markup, turning it into a DOM (Document Object Model) tree. A DOM
  tree is an in-memory representation of a document.</P><P>DOM trees contain several kinds of nodes, in particular a DOCTYPE
  node, elements, text nodes, and comment nodes.</P><P>The <A href="http://dev.w3.org/html5/spec/Overview.html#intro-early-example">markup snippet at the top of
  this section</A> would be turned into the following DOM tree:</P><UL class="domTree"><LI class="t10">DOCTYPE: <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE><UL><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">⏎␣␣</SPAN></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">Sample page</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title="">⏎␣</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title="">⏎␣</SPAN></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">⏎␣␣</SPAN></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h1</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">Sample page</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title="">⏎␣␣</SPAN></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">This is a </SPAN></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> <SPAN class="t2" title=""><CODE class="attribute name">href</CODE>="<CODE class="attribute value">demo.html</CODE>"</SPAN><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">simple</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title=""> sample.</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title="">⏎␣␣</SPAN></LI><LI class="t8"><CODE>#comment</CODE>: <SPAN title=""> this is a comment </SPAN></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title="">⏎␣⏎</SPAN></LI></UL></LI></UL></LI></UL><P>The <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A> of this tree is the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element, which is the element always found at the
  root of HTML documents. It contains two elements, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE>
  and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE>, as well as a text node between them.</P><P>There are many more text nodes in the DOM tree than one would
  initially expect, because the source contains a number of spaces
  (represented here by "␣") and line breaks ("⏎") that
  all end up as text nodes in the DOM.</P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element contains a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE>
  element, which itself contains a text node with the text "Sample
  page". Similarly, the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> element contains an
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h1</A></CODE> element, a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE> element, and a
  comment.</P><HR><P>This DOM tree can be manipulated from scripts in the
  page. Scripts (typically in JavaScript) are small programs that can
  be embedded using the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE> element or using
  <A href="http://dev.w3.org/html5/spec/Overview.html#event-handler-content-attributes">event handler content attributes</A>. For example, here is
  a form with a script that sets the value of the form's
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-output-element">output</A></CODE> element to say "Hello World":</P><PRE>&lt;<A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A> <A href="http://dev.w3.org/html5/spec/Overview.html#attr-form-name" title="attr-form-name">name</A>="main"&gt;
 Result: &lt;<A href="http://dev.w3.org/html5/spec/Overview.html#the-output-element">output</A> <A href="http://dev.w3.org/html5/spec/Overview.html#attr-fe-name" title="attr-fe-name">name</A>="result"&gt;&lt;/output&gt;
 &lt;<A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A>&gt;
  <A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument" title="HTMLDocument">document</A>.<A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-forms" title="dom-document-forms">forms</A>.main.<A href="http://dev.w3.org/html5/spec/Overview.html#dom-form-elements" title="dom-form-elements">elements</A>.result.<A href="http://dev.w3.org/html5/spec/Overview.html#dom-output-value" title="dom-output-value">value</A> = 'Hello World';
 &lt;/script&gt;
&lt;/form&gt;</PRE><P>Each element in the DOM tree is represented by an object, and
  these objects have APIs so that they can be manipulated. For
  instance, a link (e.g. the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> element in the tree above)
  can have its "<CODE title="attr-hyperlink-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-href">href</A></CODE>"
  attribute changed in several ways:</P><PRE>var a = <A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument" title="HTMLDocument">document</A>.<A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-links" title="dom-document-links">links</A>[0]; // obtain the first link in the document
a.<A href="http://dev.w3.org/html5/spec/Overview.html#dom-a-href" title="dom-a-href">href</A> = 'sample.html'; // change the destination URL of the link
a.<A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-protocol" title="dom-uda-protocol">protocol</A> = 'https'; // change just the scheme part of the URL
a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</PRE><P>Since DOM trees are used as the way to represent HTML documents
  when they are processed and presented by implementations (especially
  interactive implementations like Web browsers), this specification
  is mostly phrased in terms of DOM trees, instead of the markup
  described above.</P><HR><P>HTML documents represent a media-independent description of
  interactive content. HTML documents might be rendered to a screen,
  or through a speech synthesizer, or on a braille display. To
  influence exactly how such rendering takes place, authors can use a
  styling language such as CSS.</P><P>In the following example, the page has been made yellow-on-blue
  using CSS.</P><PRE>&lt;!DOCTYPE html&gt;
&lt;html&gt;
 &lt;head&gt;
  &lt;title&gt;Sample styled page&lt;/title&gt;
  &lt;style&gt;
   body { background: navy; color: yellow; }
  &lt;/style&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;h1&gt;Sample styled page&lt;/h1&gt;
  &lt;p&gt;This page is just a demo.&lt;/p&gt;
 &lt;/body&gt;
&lt;/html&gt;</PRE><P>For more details on how to use HTML, authors are encouraged to
  consult tutorials and guides. Some of the examples included in this
  specification might also be of use, but the novice author is
  cautioned that this specification, by necessity, defines the
  language with a level of detail that might be difficult to
  understand at first.</P><H3 id="recommended-reading"><SPAN class="secno">1.9 </SPAN>Recommended reading</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><I>This section is non-normative.</I></P><P>The following documents might be of interest to readers of this
  specification.</P><DL><DT><CITE>Character Model for the World Wide Web 1.0: Fundamentals</CITE> <A href="http://dev.w3.org/html5/spec/Overview.html#refsCHARMOD">[CHARMOD]</A></DT>

   <DD><BLOCKQUOTE><P>This Architectural Specification provides
   authors of specifications, software developers, and content
   developers with a common reference for interoperable text
   manipulation on the World Wide Web, building on the Universal
   Character Set, defined jointly by the Unicode Standard and ISO/IEC
   10646. Topics addressed include use of the terms 'character',
   'encoding' and 'string', a reference processing model, choice and
   identification of character encodings, character escaping, and
   string indexing.</P></BLOCKQUOTE></DD>

   <DT><CITE>Unicode Security Considerations</CITE> <A href="http://dev.w3.org/html5/spec/Overview.html#refsUTR36">[UTR36]</A></DT>

   <DD><BLOCKQUOTE><P>Because Unicode contains such a large number of
   characters and incorporates the varied writing systems of the
   world, incorrect usage can expose programs or systems to possible
   security attacks. This is especially important as more and more
   products are internationalized. This document describes some of the
   security considerations that programmers, system analysts,
   standards developers, and users should take into account, and
   provides specific recommendations to reduce the risk of
   problems.</P></BLOCKQUOTE></DD>

   <DT><CITE>Web Content Accessibility Guidelines (WCAG) 2.0</CITE> <A href="http://dev.w3.org/html5/spec/Overview.html#refsWCAG">[WCAG]</A></DT>

   <DD><BLOCKQUOTE><P>Web Content Accessibility Guidelines (WCAG) 2.0
   covers a wide range of recommendations for making Web content more
   accessible. Following these guidelines will make content accessible
   to a wider range of people with disabilities, including blindness
   and low vision, deafness and hearing loss, learning disabilities,
   cognitive limitations, limited movement, speech disabilities,
   photosensitivity and combinations of these. Following these
   guidelines will also often make your Web content more usable to
   users in general.</P></BLOCKQUOTE></DD>

   <DT class="impl"><CITE>Authoring Tool Accessibility Guidelines (ATAG) 2.0</CITE> <A href="http://dev.w3.org/html5/spec/Overview.html#refsATAG">[ATAG]</A></DT>

   <DD class="impl"><BLOCKQUOTE><P>This specification provides
   guidelines for designing Web content authoring tools that are more
   accessible for people with disabilities. An authoring tool that
   conforms to these guidelines will promote accessibility by
   providing an accessible user interface to authors with disabilities
   as well as by enabling, supporting, and promoting the production of
   accessible Web content by all authors.</P></BLOCKQUOTE></DD>

   <DT class="impl"><CITE>User Agent Accessibility Guidelines (UAAG) 2.0</CITE> <A href="http://dev.w3.org/html5/spec/Overview.html#refsUAAG">[UAAG]</A></DT>

   <DD class="impl"><BLOCKQUOTE><P>This document provides guidelines
   for designing user agents that lower barriers to Web accessibility
   for people with disabilities. User agents include browsers and
   other types of software that retrieve and render Web content. A
   user agent that conforms to these guidelines will promote
   accessibility through its own user interface and through other
   internal facilities, including its ability to communicate with
   other technologies (especially assistive
   technologies). Furthermore, all users, not just users with
   disabilities, should find conforming user agents to be more
   usable.</P></BLOCKQUOTE></DD>

  </DL><H2 id="infrastructure"><SPAN class="secno">2 </SPAN>Common infrastructure</H2><H3 id="terminology"><SPAN class="secno">2.1 </SPAN>Terminology</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>This specification refers to both HTML and XML attributes and IDL
  attributes, often in the same context. When it is not clear which is
  being referred to, they are referred to as <DFN title="">content
  attributes</DFN> for HTML and XML attributes, and <DFN title="">IDL
  attributes</DFN> for those defined on IDL interfaces. Similarly, the
  term "properties" is used for both JavaScript object properties and
  CSS properties. When these are ambiguous they are qualified as <DFN title="">object properties</DFN> and <DFN title="">CSS
  properties</DFN> respectively.</P><P>Generally, when the specification states that a feature applies
  to <A href="http://dev.w3.org/html5/spec/Overview.html#syntax">the HTML syntax</A> or <A href="http://dev.w3.org/html5/spec/Overview.html#the-xhtml-syntax">the XHTML syntax</A>, it
  also includes the other. When a feature specifically only applies to
  one of the two languages, it is called out by explicitly stating
  that it does not apply to the other format, as in "for HTML,
  ... (this does not apply to XHTML)".</P><P>This specification uses the term <DFN title="">document</DFN> to
  refer to any use of HTML, ranging from short static documents to
  long essays or reports with rich multimedia, as well as to
  fully-fledged interactive applications.</P><P>For simplicity, terms such as <DFN title="">shown</DFN>, <DFN title="">displayed</DFN>, and <DFN title="">visible</DFN> might
  sometimes be used when referring to the way a document is rendered
  to the user. These terms are not meant to imply a visual medium;
  they must be considered to apply to other media in equivalent
  ways.</P><P>When an algorithm B says to return to another algorithm A, it
  implies that A called B. Upon returning to A, the implementation
  must continue from where it left off in calling B.</P><H4 id="resources"><SPAN class="secno">2.1.1 </SPAN>Resources</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The specification uses the term <DFN title="">supported</DFN>
  when referring to whether a user agent has an implementation capable
  of decoding the semantics of an external resource. A format or type
  is said to be <I>supported</I> if the implementation can process an
  external resource of that format or type without critical aspects of
  the resource being ignored. Whether a specific resource is
  <I>supported</I> can depend on what features of the resource's
  format are in use.</P><P class="example">For example, a PNG image would be considered to
  be in a supported format if its pixel data could be decoded and
  rendered, even if, unbeknownst to the implementation, the image also
  contained animation data.</P><P class="example">A MPEG4 video file would not be considered to be
  in a supported format if the compression format used was not
  supported, even if the implementation could determine the dimensions
  of the movie from the file's metadata.</P><P>The term <DFN id="mime-type">MIME type</DFN> is used to refer to what is
  sometimes called an <I>Internet media type</I> in protocol
  literature. The term <I>media type</I> in this specification is used
  to refer to the type of media intended for presentation, as used by
  the CSS specifications. <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC2046">[RFC2046]</A> <A href="http://dev.w3.org/html5/spec/Overview.html#refsMQ">[MQ]</A></P><P>A string is a <DFN id="valid-mime-type">valid MIME type</DFN> if it matches the <CODE title="">media-type</CODE> rule defined in section 3.7 "Media Types"
  of RFC 2616. In particular, a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-mime-type">valid MIME type</A> may
  include MIME type parameters. <A href="http://dev.w3.org/html5/spec/Overview.html#refsHTTP">[HTTP]</A></P><P>A string is a <DFN id="valid-mime-type-with-no-parameters">valid MIME type with no parameters</DFN> if it
  matches the <CODE title="">media-type</CODE> rule defined in section
  3.7 "Media Types" of RFC 2616, but does not contain any U+003B
  SEMICOLON characters (;). In other words, if it consists only of a
  type and subtype, with no MIME Type parameters. <A href="http://dev.w3.org/html5/spec/Overview.html#refsHTTP">[HTTP]</A></P><P>The term <DFN id="html-mime-type">HTML MIME type</DFN> is used to refer to the <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type" title="MIME type">MIME types</A> <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#text-html">text/html</A></CODE> and
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#text-html-sandboxed">text/html-sandboxed</A></CODE>.</P><H4 id="xml"><SPAN class="secno">2.1.2 </SPAN>XML</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P id="html-namespace">To ease migration from HTML to XHTML, UAs
  conforming to this specification will place elements in HTML in the
  <CODE>http://www.w3.org/1999/xhtml</CODE> namespace, at least for
  the purposes of the DOM and CSS. The term "<DFN id="html-elements">HTML
  elements</DFN>", when used in this specification, refers to any
  element in that namespace, and thus refers to both HTML and XHTML
  elements.</P><P>Except where otherwise stated, all elements defined or mentioned
  in this specification are in the
  <CODE>http://www.w3.org/1999/xhtml</CODE> namespace, and all
  attributes defined or mentioned in this specification have no
  namespace.</P><P>Attribute names are said to be <DFN id="xml-compatible">XML-compatible</DFN> if they
  match the <A href="http://www.w3.org/TR/REC-xml/#NT-Name"><CODE title="">Name</CODE></A> production defined in XML, they contain no
  U+003A COLON characters (:), and their first three characters are
  not an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII case-insensitive</A> match for the string
  "<CODE title="">xml</CODE>". <A href="http://dev.w3.org/html5/spec/Overview.html#refsXML">[XML]</A></P><P>The term <DFN id="xml-mime-type">XML MIME type</DFN> is used to refer to the <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type" title="MIME type">MIME types</A> <CODE title="">text/xml</CODE>,
  <CODE title="">application/xml</CODE>, and any <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type">MIME
  type</A> whose subtype ends with the four characters "<CODE title="">+xml</CODE>". <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC3023">[RFC3023]</A></P><H4 id="dom-trees"><SPAN class="secno">2.1.3 </SPAN>DOM trees</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The term <DFN id="root-element">root element</DFN>, when not explicitly qualified
  as referring to the document's root element, means the furthest
  ancestor element node of whatever node is being discussed, or the
  node itself if it has no ancestors. When the node is a part of the
  document, then that is indeed the document's root element; however,
  if the node is not currently part of the document tree, the root
  element will be an orphaned node.</P><P>A node's <DFN id="home-subtree">home subtree</DFN> is the subtree rooted at that
  node's <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A>.</P><P>The <CODE>Document</CODE> of a <CODE>Node</CODE> (such as an
  element) is the <CODE>Document</CODE> that the <CODE>Node</CODE>'s
  <CODE title="">ownerDocument</CODE> IDL attribute returns.</P><P>When an element's <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A> is the <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root
  element</A> of a <CODE>Document</CODE>, it is said to be <DFN id="in-a-document">in
  a <CODE>Document</CODE></DFN>. An element is said to have been <DFN id="insert-an-element-into-a-document" title="insert an element into a document">inserted into a
  document</DFN> when its <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A> changes and is now
  the document's <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A>. Analogously, an element is
  said to have been <DFN id="remove-an-element-from-a-document" title="remove an element from a
  document">removed from a document</DFN> when its <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root
  element</A> changes from being the document's <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root
  element</A> to being another element.</P><P>If a <CODE>Node</CODE> is <A href="http://dev.w3.org/html5/spec/Overview.html#in-a-document">in a <CODE>Document</CODE></A>
  then that <CODE>Document</CODE> is always the <CODE>Node</CODE>'s
  <CODE>Document</CODE>, and the <CODE>Node</CODE>'s <CODE title="">ownerDocument</CODE> IDL attribute thus always returns that
  <CODE>Document</CODE>.</P><P>The term <DFN id="tree-order">tree order</DFN> means a pre-order, depth-first
  traversal of DOM nodes involved (through the <CODE title="">parentNode</CODE>/<CODE title="">childNodes</CODE>
  relationship).</P><P>When it is stated that some element or attribute is <DFN id="ignore" title="ignore">ignored</DFN>, or treated as some other value, or
  handled as if it was something else, this refers only to the
  processing of the node after it is in the DOM. <SPAN class="impl">A
  user agent must not mutate the DOM in such situations.</SPAN></P><P>The term <DFN id="text-node">text node</DFN> refers to any <CODE>Text</CODE>
  node, including <CODE>CDATASection</CODE> nodes; specifically, any
  <CODE>Node</CODE> with node type <CODE title="">TEXT_NODE</CODE> (3)
  or <CODE title="">CDATA_SECTION_NODE</CODE> (4). <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMCORE]</A></P><P>A content attribute is said to <DFN title="">change</DFN> value
  only if its new value is different than its previous value; setting
  an attribute to a value it already has does not change it.</P><H4 id="scripting-0"><SPAN class="secno">2.1.4 </SPAN>Scripting</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The construction "a <CODE>Foo</CODE> object", where
  <CODE>Foo</CODE> is actually an interface, is sometimes used instead
  of the more accurate "an object implementing the interface
  <CODE>Foo</CODE>".</P><P>An IDL attribute is said to be <DFN title="">getting</DFN> when
  its value is being retrieved (e.g. by author script), and is said to
  be <DFN title="">setting</DFN> when a new value is assigned to
  it.</P><P>If a DOM object is said to be <DFN id="live">live</DFN>, then that means
  that any attributes returning that object <SPAN class="impl">must</SPAN> always return the same object (not a new
  object each time), and the attributes and methods on that object
  <SPAN class="impl">must</SPAN> operate on the actual underlying
  data, not a snapshot of the data.</P><P>The terms <DFN title="">fire</DFN> and <DFN title="">dispatch</DFN> are used interchangeably in the context of
  events, as in the DOM Events specifications. The term <DFN id="concept-events-trusted" title="concept-events-trusted">trusted event</DFN> is used as
  defined by the DOM Events specification. <!--
  http://krijnhoetmer.nl/irc-logs/webapps/20091218 --> <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMEVENTS">[DOMEVENTS]</A></P><H4 id="plugins"><SPAN class="secno">2.1.5 </SPAN>Plugins</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The term <DFN id="plugin">plugin</DFN> is used to mean any content handler
  for Web content types that are either not supported by the user
  agent natively or that do not expose a DOM, which supports rendering
  the content as part of the user agent's interface.</P><P>Typically such content handlers are provided by third
  parties.</P><P class="example">One example of a plugin would be a PDF viewer
  that is instantiated in a <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A> when the
  user navigates to a PDF file. This would count as a plugin
  regardless of whether the party that implemented the PDF viewer
  component was the same as that which implemented the user agent
  itself. However, a PDF viewer application that launches separate
  from the user agent (as opposed to using the same interface) is not
  a plugin by this definition.</P><P class="note">This specification does not define a mechanism for
  interacting with plugins, as it is expected to be user-agent- and
  platform-specific. Some UAs might opt to support a plugin mechanism
  such as the Netscape Plugin API; others might use remote content
  converters or have built-in support for certain types. <A href="http://dev.w3.org/html5/spec/Overview.html#refsNPAPI">[NPAPI]</A></P><P class="warning">Browsers should take extreme care when
  interacting with external content intended for <A href="http://dev.w3.org/html5/spec/Overview.html#plugin" title="plugin">plugins</A>. When third-party software is run with
  the same privileges as the user agent itself, vulnerabilities in the
  third-party software become as dangerous as those in the user
  agent.</P><H4 id="character-encodings"><SPAN class="secno">2.1.6 </SPAN>Character encodings</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <DFN id="preferred-mime-name">preferred MIME name</DFN> of a character encoding is the
  name or alias labeled as "preferred MIME name" in the IANA
  <CITE>Character Sets</CITE> registry, if there is one, or the
  encoding's name, if none of the aliases are so labeled. <A href="http://dev.w3.org/html5/spec/Overview.html#refsIANACHARSET">[IANACHARSET]</A></P><P>An <DFN id="ascii-compatible-character-encoding">ASCII-compatible character encoding</DFN> is a
  single-byte or variable-length encoding in which the bytes 0x09,
  0x0A, 0x0C, 0x0D, 0x20 - 0x22, 0x26, 0x27, 0x2C - 0x3F, 0x41 - 0x5A,
  and 0x61 - 0x7A<!-- is that list ok? do any character sets we want
  to support do things outside that range?  -->, ignoring bytes that
  are the second and later bytes of multibyte sequences, all
  correspond to single-byte sequences that map to the same Unicode
  characters as those bytes in ANSI_X3.4-1968 (US-ASCII). <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC1345">[RFC1345]</A></P><P class="note">This includes such encodings as Shift_JIS,
  HZ-GB-2312, and variants of ISO-2022, even though it is possible in
  these encodings for bytes like 0x70 to be part of longer sequences
  that are unrelated to their interpretation as ASCII. It excludes
  such encodings as UTF-7, UTF-16, GSM03.38, and EBCDIC variants.</P><!--
   We'll have to change that if anyone comes up with a way to have a
   document that is valid as two different encodings at once, with
   different <meta charset> elements applying in each case.
  --><P>The term <DFN title="">Unicode character</DFN> is used to mean a
  <I title="">Unicode scalar value</I> (i.e. any Unicode code point
  that is not a surrogate code point). <A href="http://dev.w3.org/html5/spec/Overview.html#refsUNICODE">[UNICODE]</A></P><H3 id="conformance-requirements"><SPAN class="secno">2.2 </SPAN>Conformance requirements</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>All diagrams, examples, and notes in this specification are
  non-normative, as are all sections explicitly marked non-normative.
  Everything else in this specification is normative.</P><P>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
  NOT",--> "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
  "OPTIONAL" in the normative parts of this document are to be
  interpreted as described in RFC2119. For readability, these words do
  not appear in all uppercase letters in this specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC2119">[RFC2119]</A></P><P class="impl">Requirements phrased in the imperative as part of
  algorithms (such as "strip any leading space characters" or "return
  false and abort these steps") are to be interpreted with the meaning
  of the key word ("must", "should", "may", etc) used in introducing
  the algorithm.</P><P>This specification describes the conformance criteria for <SPAN class="impl">user agents (relevant to implementors) and</SPAN>
  documents<SPAN class="impl"> (relevant to authors and authoring tool
  implementors)</SPAN>.</P><P class="note impl">There is no implied relationship between
  document conformance requirements and implementation conformance
  requirements. User agents are not free to handle non-conformant
  documents as they please; the processing model described in this
  specification applies to implementations regardless of the
  conformity of the input documents.</P><DIV class="impl">

  <!-- put this list into its own section -->

  <P>User agents fall into several (overlapping) categories with
  different conformance requirements.</P>

  <DL><DT id="interactive">Web browsers and other interactive user agents</DT>

   <DD>

    <P>Web browsers that support <A href="http://dev.w3.org/html5/spec/Overview.html#the-xhtml-syntax">the XHTML syntax</A> must
    process elements and attributes from the <A href="http://dev.w3.org/html5/spec/Overview.html#html-namespace-0">HTML
    namespace</A> found in XML documents as described in this
    specification, so that users can interact with them, unless the
    semantics of those elements have been overridden by other
    specifications.</P>

    <P class="example">A conforming XHTML processor would, upon
    finding an XHTML <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE> element in an XML document,
    execute the script contained in that element. However, if the
    element is found within a transformation expressed in XSLT
    (assuming the user agent also supports XSLT), then the processor
    would instead treat the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE> element as an opaque
    element that forms part of the transform.</P>

    <P>Web browsers that support <A href="http://dev.w3.org/html5/spec/Overview.html#syntax">the HTML syntax</A> must
    process documents labeled with an <A href="http://dev.w3.org/html5/spec/Overview.html#html-mime-type">HTML MIME type</A> as
    described in this specification, so that users can interact with
    them.</P>

    <P>User agents that support scripting must also be conforming
    implementations of the IDL fragments in this specification, as
    described in the Web IDL specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsWEBIDL">[WEBIDL]</A></P>

    <P class="note">Unless explicitly stated, specifications that
    override the semantics of HTML elements do not override the
    requirements on DOM objects representing those elements. For
    example, the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE> element in the example above
    would still implement the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlscriptelement">HTMLScriptElement</A></CODE>
    interface.</P>

   </DD>

   <DT id="non-interactive">Non-interactive presentation user agents</DT>

   <DD>

    <P>User agents that process HTML and XHTML documents purely to
    render non-interactive versions of them must comply to the same
    conformance criteria as Web browsers, except that they are exempt
    from requirements regarding user interaction.</P>

    <P class="note">Typical examples of non-interactive presentation
    user agents are printers (static UAs) and overhead displays
    (dynamic UAs). It is expected that most static non-interactive
    presentation user agents will also opt to <A href="http://dev.w3.org/html5/spec/Overview.html#non-scripted">lack scripting support</A>.</P>

    <P class="example">A non-interactive but dynamic presentation UA
    would still execute scripts, allowing forms to be dynamically
    submitted, and so forth. However, since the concept of "focus" is
    irrelevant when the user cannot interact with the document, the UA
    would not need to support any of the focus-related DOM APIs.</P>

   </DD>

   <DT><DFN id="non-scripted">User agents with no scripting support</DFN></DT>

   <DD>

    <P>Implementations that do not support scripting (or which have
    their scripting features disabled entirely) are exempt from
    supporting the events and DOM interfaces mentioned in this
    specification. For the parts of this specification that are
    defined in terms of an events model or in terms of the DOM, such
    user agents must still act as if events and the DOM were
    supported.</P>

    <P class="note">Scripting can form an integral part of an
    application. Web browsers that do not support scripting, or that
    have scripting disabled, might be unable to fully convey the
    author's intent.</P>

   </DD>

   <DT>Conformance checkers</DT>

   <DD id="conformance-checkers">

    <P>Conformance checkers must verify that a document conforms to
    the applicable conformance criteria described in this
    specification. Automated conformance checkers are exempt from
    detecting errors that require interpretation of the author's
    intent (for example, while a document is non-conforming if the
    content of a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-blockquote-element">blockquote</A></CODE> element is not a quote,
    conformance checkers running without the input of human judgement
    do not have to check that <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-blockquote-element">blockquote</A></CODE> elements only
    contain quoted material).</P>

    <P>Conformance checkers must check that the input document
    conforms when parsed without a <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A>
    (meaning that no scripts are run, and that the parser's
    <A href="http://dev.w3.org/html5/spec/Overview.html#scripting-flag">scripting flag</A> is disabled), and should also check
    that the input document conforms when parsed with a <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing
    context</A> in which scripts execute, and that the scripts
    never cause non-conforming states to occur other than transiently
    during script execution itself. (This is only a "SHOULD" and not a
    "MUST" requirement because it has been proven to be impossible. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCOMPUTABLE">[COMPUTABLE]</A>)</P>

    <P>The term "HTML5 validator" can be used to refer to a
    conformance checker that itself conforms to the applicable
    requirements of this specification.</P>

    <DIV class="note">

     <P>XML DTDs cannot express all the conformance requirements of
     this specification. Therefore, a validating XML processor and a
     DTD cannot constitute a conformance checker. Also, since neither
     of the two authoring formats defined in this specification are
     applications of SGML, a validating SGML system cannot constitute
     a conformance checker either.</P>

     <P>To put it another way, there are three types of conformance
     criteria:</P>

     <OL><LI>Criteria that can be expressed in a DTD.</LI>

      <LI>Criteria that cannot be expressed by a DTD, but can still be
      checked by a machine.</LI>

      <LI>Criteria that can only be checked by a human.</LI>

     </OL><P>A conformance checker must check for the first two. A simple
     DTD-based validator only checks for the first class of errors and
     is therefore not a conforming conformance checker according to
     this specification.</P>

    </DIV>
   </DD>

   <DT>Data mining tools</DT>

   <DD id="data-mining">

    <P>Applications and tools that process HTML and XHTML documents
    for reasons other than to either render the documents or check
    them for conformance should act in accordance with the semantics
    of the documents that they process.</P>

    <P class="example">A tool that generates <A href="http://dev.w3.org/html5/spec/Overview.html#outline" title="outline">document outlines</A> but increases the nesting
    level for each paragraph and does not increase the nesting level
    for each section would not be conforming.</P>

   </DD>

   <DT id="editors">Authoring tools and markup generators</DT>

   <DD>

    <P>Authoring tools and markup generators must generate conforming
    documents. Conformance criteria that apply to authors also apply
    to authoring tools, where appropriate.</P>

    <P>Authoring tools are exempt from the strict requirements of
    using elements only for their specified purpose, but only to the
    extent that authoring tools are not yet able to determine author
    intent. However, authoring tools must not automatically misuse
    elements or encourage their users to do so.</P>

    <P class="example">For example, it is not conforming to use an
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-address-element">address</A></CODE> element for arbitrary contact information;
    that element can only be used for marking up contact information
    for the author of the document or section. However, since an
    authoring tool is likely unable to determine the difference, an
    authoring tool is exempt from that requirement. This does not
    mean, though, that authoring tools can use <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-address-element">address</A></CODE>
    elements for any block of italics text (for instance); it just
    means that the authoring tool doesn't have to verify that when the
    user uses a tool for inserting contact information for a section,
    that the user really is doing that and not inserting something
    else instead.</P>

    <P class="note">In terms of conformance checking, an editor has to
    output documents that conform to the same extent that a
    conformance checker will verify.</P>

    <P>When an authoring tool is used to edit a non-conforming
    document, it may preserve the conformance errors in sections of
    the document that were not edited during the editing session
    (i.e. an editing tool is allowed to round-trip erroneous
    content). However, an authoring tool must not claim that the
    output is conformant if errors have been so preserved.</P>

    <P>Authoring tools are expected to come in two broad varieties:
    tools that work from structure or semantic data, and tools that
    work on a What-You-See-Is-What-You-Get media-specific editing
    basis (WYSIWYG).</P>

    <P>The former is the preferred mechanism for tools that author
    HTML, since the structure in the source information can be used to
    make informed choices regarding which HTML elements and attributes
    are most appropriate.</P>

    <P>However, WYSIWYG tools are legitimate. WYSIWYG tools should use
    elements they know are appropriate, and should not use elements
    that they do not know to be appropriate. This might in certain
    extreme cases mean limiting the use of flow elements to just a few
    elements, like <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-b-element">b</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-i-element">i</A></CODE>,
    and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-span-element">span</A></CODE> and making liberal use of the <CODE title="attr-style"><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute">style</A></CODE> attribute.</P>

    <P>All authoring tools, whether WYSIWYG or not, should make a best
    effort attempt at enabling users to create well-structured,
    semantically rich, media-independent content.</P>

   </DD>

  </DL><P>Some conformance requirements are phrased as requirements on
  elements, attributes, methods or objects. Such requirements fall
  into two categories: those describing content model restrictions,
  and those describing implementation behavior. Those in the former
  category are requirements on documents and authoring tools. Those in
  the second category are requirements on user agents. Similarly, some
  conformance requirements are phrased as requirements on authors;
  such requirements are to be interpreted as conformance requirements
  on the documents that authors produce. (In other words, this
  specification does not distinguish between conformance criteria on
  authors and conformance criteria on documents.)</P>

  <P>Conformance requirements phrased as algorithms or specific steps
  may be implemented in any manner, so long as the end result is
  equivalent. (In particular, the algorithms defined in this
  specification are intended to be easy to follow, and not intended to
  be performant.)</P>

  <P id="hardwareLimitations">User agents may impose
  implementation-specific limits on otherwise unconstrained inputs,
  e.g. to prevent denial of service attacks, to guard against running
  out of memory, or to work around platform-specific limitations.</P>

  </DIV><P>For compatibility with existing content and prior specifications,
  this specification describes two authoring formats: one based on XML
  (referred to as <A href="http://dev.w3.org/html5/spec/Overview.html#the-xhtml-syntax">the XHTML syntax</A>), and one using a <A href="http://dev.w3.org/html5/spec/Overview.html#writing">custom format</A> inspired by SGML (referred to as
  <A href="http://dev.w3.org/html5/spec/Overview.html#syntax">the HTML syntax</A>). <SPAN class="impl">Implementations
  may support only one of these two formats, although supporting both
  is encouraged.</SPAN></P><P class="impl" id="entity-references">The language in this
  specification assumes that the user agent expands all entity
  references, and therefore does not include entity reference nodes in
  the DOM. If user agents do include entity reference nodes in the
  DOM, then user agents must handle them as if they were fully
  expanded when implementing this specification. For example, if a
  requirement talks about an element's child text nodes, then any text
  nodes that are children of an entity reference that is a child of
  that element would be used as well. Entity references to unknown
  entities must be treated as if they contained just an empty text
  node for the purposes of the algorithms defined in this
  specification.</P><DIV class="impl">

  <H4 id="dependencies"><SPAN class="secno">2.2.1 </SPAN>Dependencies</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>This specification relies on several other underlying
  specifications.</P>

  <DL><DT>XML</DT>

   <DD>

    <P>Implementations that support <A href="http://dev.w3.org/html5/spec/Overview.html#the-xhtml-syntax">the XHTML syntax</A> must
    support some version of XML, as well as its corresponding
    namespaces specification, because that syntax uses an XML
    serialization with namespaces. <A href="http://dev.w3.org/html5/spec/Overview.html#refsXML">[XML]</A> <A href="http://dev.w3.org/html5/spec/Overview.html#refsXMLNS">[XMLNS]</A></P>

   </DD>

   <DT>DOM</DT>

   <DD>

    <P>The Document Object Model (DOM) is a representation — a
    model — of a document and its content. The DOM is not just
    an API; the conformance criteria of HTML implementations are
    defined, in this specification, in terms of operations on the DOM.
    <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMCORE]</A></P>

    <P>Implementations must support some version of DOM Core and DOM
    Events, because this specification is defined in terms of the DOM,
    and some of the features are defined as extensions to the DOM Core
    interfaces. <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMCORE]</A> <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMEVENTS]</A></P>

   </DD>

   <DT>Web IDL</DT>

   <DD>

    <P>The IDL fragments in this specification must be interpreted as
    required for conforming IDL fragments, as described in the Web IDL
    specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsWEBIDL">[WEBIDL]</A></P>

    <P id="float-nan">Except where otherwise specified, if an IDL
    attribute that is a floating point number type (<CODE title="">float</CODE>) is assigned an Infinity or Not-a-Number
    (NaN) value, a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#not_supported_err">NOT_SUPPORTED_ERR</A></CODE> exception must be
    raised.</P>

    <P>Except where otherwise specified, if a method with an argument
    that is a floating point number type (<CODE title="">float</CODE>)
    is passed an Infinity or Not-a-Number (NaN) value, a
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#not_supported_err">NOT_SUPPORTED_ERR</A></CODE> exception must be raised.</P>

   </DD>

   <DT>JavaScript</DT>

   <DD>

    <P>Some parts of the language described by this specification only
    support JavaScript as the underlying scripting language. <A href="http://dev.w3.org/html5/spec/Overview.html#refsECMA262">[ECMA262]</A></P>

    <P class="note">The term "JavaScript" is used to refer to ECMA262,
    rather than the official term ECMAScript, since the term
    JavaScript is more widely known. Similarly, the <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type">MIME
    type</A> used to refer to JavaScript in this specification is
    <CODE title="">text/javascript</CODE>, since that is the most
    commonly used type, <A href="http://dev.w3.org/html5/spec/Overview.html#willful-violation" title="willful violation">despite it
    being an officially obsoleted type</A> according to RFC
    4329. <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC4329">[RFC4329]</A></P>

   </DD>

   <DT>Media Queries</DT>

   <DD>

    <P>Implementations must support some version of the Media Queries
    language. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMQ">[MQ]</A></P>

   </DD>

   <DT>URIs, IRIs, IDNA</DT>

   <DD>

    <P>Implementations must support the semantics of <A href="http://dev.w3.org/html5/spec/Overview.html#url" title="URL">URLs</A> defined in the URI and IRI specifications,
    as well as the semantics of IDNA domain names defined in the
    <CITE>Internationalizing Domain Names in Applications
    (IDNA)</CITE> specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC3986">[RFC3986]</A>
    <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC3987">[RFC3987]</A> <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC3490">[RFC3490]</A>

   </P></DD>

  </DL><P>This specification does not <EM>require</EM> support of any
  particular network transport protocols, style sheet language,
  scripting language, or any of the DOM specifications beyond those
  described above. However, the language described by this
  specification is biased towards CSS as the styling language,
  JavaScript as the scripting language, and HTTP as the network
  protocol, and several features assume that those languages and
  protocols are in use.</P>

  <P class="note">This specification might have certain additional
  requirements on character encodings, image formats, audio formats,
  and video formats in the respective sections.</P>

  </DIV><DIV class="impl">

  <H4 id="extensibility"><SPAN class="secno">2.2.2 </SPAN>Extensibility</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments. </I><SPAN><A href="http://www.w3.org/html/wg/tracker/issues/41">ISSUE-41</A> (Decentralized-extensibility) blocks progress to Last Call</SPAN></P>

  <P>Vendor-specific proprietary extensions to this specification are
  strongly discouraged. Documents must not use such extensions, as
  doing so reduces interoperability and fragments the user base,
  allowing only users of specific user agents to access the content in
  question.</P>

  <P>If vendor-specific markup extensions are needed, they should be
  done using XML, with elements or attributes from custom
  namespaces. If such DOM extensions are needed, the members should be
  prefixed by vendor-specific strings to prevent clashes with future
  versions of this specification. Extensions must be defined so that
  the use of extensions neither contradicts nor causes the
  non-conformance of functionality defined in the specification.</P>
  <!-- thanks to QA Framework -->

  <DIV class="example">

   <P>For example, while strongly discouraged from doing so, an
   implementation "Foo Browser" could add a new IDL attribute "<CODE title="">fooTypeTime</CODE>" to a control's DOM interface that
   returned the time it took the user to select the current value of a
   control (say). On the other hand, defining a new control that
   appears in a form's <CODE title="dom-form-elements"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-form-elements">elements</A></CODE>
   array would be in violation of the above requirement, as it would
   violate the definition of <CODE title="dom-form-elements"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-form-elements">elements</A></CODE> given in this
   specification.</P>

  </DIV>

  <HR><P>When vendor-neutral extensions to this specification are needed,
  either this specification can be updated accordingly, or an
  extension specification can be written that overrides the
  requirements in this specification. When someone applying this
  specification to their activities decides that they will recognise
  the requirements of such an extension specification, it becomes an
  <DFN id="other-applicable-specifications" title="other applicable specifications">applicable
  specification</DFN> for the purposes of conformance requirements in
  this specification.</P>
  <!-- http://www.w3.org/mid/17E341CD-E790-422C-9F9A-69347EE01CEB@iki.fi -->

  <HR><P>User agents must treat elements and attributes that they do not
  understand as semantically neutral; leaving them in the DOM (for DOM
  processors), and styling them according to CSS (for CSS processors),
  but not inferring any meaning from them.</P>

  </DIV><H3 id="case-sensitivity-and-string-comparison"><SPAN class="secno">2.3 </SPAN>Case-sensitivity and string comparison</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Comparing two strings in a <DFN id="case-sensitive">case-sensitive</DFN> manner means
  comparing them exactly, code point for code point.</P><P>Comparing two strings in an <DFN id="ascii-case-insensitive">ASCII case-insensitive</DFN>
  manner means comparing them exactly, code point for code point, except
  that the characters in the range U+0041 to U+005A (i.e. LATIN
  CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and the corresponding
  characters in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A
  to LATIN SMALL LETTER Z) are considered to also match.</P><P>Comparing two strings in a <DFN id="compatibility-caseless">compatibility caseless</DFN>
  manner means using the Unicode <I>compatibility caseless match</I>
  operation to compare the two strings. <A href="http://dev.w3.org/html5/spec/Overview.html#refsUNICODE">[UNICODE]</A></P><DIV class="impl">

  <P><DFN id="converted-to-ascii-uppercase" title="converted to ASCII uppercase">Converting a string to
  ASCII uppercase</DFN> means replacing all characters in the range
  U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z)
  with the corresponding characters in the range U+0041 to U+005A
  (i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).</P>

  <P><DFN id="converted-to-ascii-lowercase" title="converted to ASCII lowercase">Converting a string to
  ASCII lowercase</DFN> means replacing all characters in the range
  U+0041 to U+005A (i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL
  LETTER Z) with the corresponding characters in the range U+0061
  to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z).</P>

  </DIV><P>A string <VAR title="">pattern</VAR> is a <DFN id="prefix-match">prefix match</DFN>
  for a string <VAR title="">s</VAR> when <VAR title="">pattern</VAR>
  is not longer than <VAR title="">s</VAR> and truncating <VAR title="">s</VAR> to <VAR title="">pattern</VAR>'s length leaves the
  two strings as matches of each other.</P><H3 id="common-microsyntaxes"><SPAN class="secno">2.4 </SPAN>Common microsyntaxes</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>There are various places in HTML that accept particular data
  types, such as dates or numbers. This section describes what the
  conformance criteria for content in those formats is, and how to
  parse them.</P><DIV class="impl">

  <P class="note">Implementors are strongly urged to carefully examine
  any third-party libraries they might consider using to implement the
  parsing of syntaxes described below. For example, date libraries are
  likely to implement error handling behavior that differs from what
  is required in this specification, since error-handling behavior is
  often not defined in specifications that describe date syntaxes
  similar to those used in this specification, and thus
  implementations tend to vary greatly in how they handle errors.</P>

  </DIV><DIV class="impl">

  <H4 id="common-parser-idioms"><SPAN class="secno">2.4.1 </SPAN>Common parser idioms</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>The <DFN id="space-character" title="space character">space characters</DFN>, for the
  purposes of this specification, are U+0020 SPACE, U+0009 CHARACTER
  TABULATION (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), and
  U+000D CARRIAGE RETURN (CR).</P>

  <P>The <DFN id="white_space" title="White_Space">White_Space characters</DFN> are
  those that have the Unicode property "White_Space". <A href="http://dev.w3.org/html5/spec/Overview.html#refsUNICODE">[UNICODE]</A></P>

  <P>The <DFN id="alphanumeric-ascii-characters">alphanumeric ASCII characters</DFN> are those in the
  ranges U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), U+0041 LATIN
  CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z, U+0061 LATIN
  SMALL LETTER A to U+007A LATIN SMALL LETTER Z.</P>

  <P>Some of the micro-parsers described below follow the pattern of
  having an <VAR title="">input</VAR> variable that holds the string
  being parsed, and having a <VAR title="">position</VAR> variable
  pointing at the next character to parse in <VAR title="">input</VAR>.</P>

  <P>For parsers based on this pattern, a step that requires the user
  agent to <DFN id="collect-a-sequence-of-characters">collect a sequence of characters</DFN> means that the
  following algorithm must be run, with <VAR title="">characters</VAR>
  being the set of characters that can be collected:</P>

  <OL><LI><P>Let <VAR title="">input</VAR> and <VAR title="">position</VAR> be the same variables as those of the same
   name in the algorithm that invoked these steps.</P></LI>

   <LI><P>Let <VAR title="">result</VAR> be the empty string.</P></LI>

   <LI><P>While <VAR title="">position</VAR> doesn't point past the
   end of <VAR title="">input</VAR> and the character at <VAR title="">position</VAR> is one of the <VAR title="">characters</VAR>, append that character to the end of <VAR title="">result</VAR> and advance <VAR title="">position</VAR> to
   the next character in <VAR title="">input</VAR>.</P></LI>

   <LI><P>Return <VAR title="">result</VAR>.</P></LI>

  </OL><P>The step <DFN id="skip-whitespace">skip whitespace</DFN> means that the user agent
  must <A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">collect a sequence of characters</A> that are <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>. The step <DFN id="skip-white_space-characters">skip
  White_Space characters</DFN> means that the user agent must
  <A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">collect a sequence of characters</A> that are
  <A href="http://dev.w3.org/html5/spec/Overview.html#white_space">White_Space</A> characters. In both cases, the collected
  characters are not used. <A href="http://dev.w3.org/html5/spec/Overview.html#refsUNICODE">[UNICODE]</A></P>

  <P>When a user agent is to <DFN id="strip-line-breaks">strip line breaks</DFN> from a
  string, the user agent must remove any U+000A LINE FEED (LF) and
  U+000D CARRIAGE RETURN (CR) characters from that string.</P>

  <P>The <DFN id="code-point-length">code-point length</DFN> of a string is the number of
  Unicode code points in that string.</P>

  </DIV><H4 id="boolean-attributes"><SPAN class="secno">2.4.2 </SPAN>Boolean attributes</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A number of attributes are <DFN id="boolean-attribute" title="boolean attribute">boolean
  attributes</DFN>. The presence of a boolean attribute on an element
  represents the true value, and the absence of the attribute
  represents the false value.</P><P>If the attribute is present, its value must either be the empty
  string or a value that is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII case-insensitive</A>
  match for the attribute's canonical name, with no leading or
  trailing whitespace.</P><P class="note">The values "true" and "false" are not allowed on
  boolean attributes. To represent a false value, the attribute has to
  be omitted altogether.</P><H4 id="keywords-and-enumerated-attributes"><SPAN class="secno">2.4.3 </SPAN>Keywords and enumerated attributes</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Some attributes are defined as taking one of a finite set of
  keywords. Such attributes are called <DFN id="enumerated-attribute" title="enumerated
  attribute">enumerated attributes</DFN>. The keywords are each
  defined to map to a particular <EM>state</EM> (several keywords
  might map to the same state, in which case some of the keywords are
  synonyms of each other; additionally, some of the keywords can be
  said to be non-conforming, and are only in the specification for
  historical reasons). In addition, two default states can be
  given. The first is the <I>invalid value default</I>, the second
  is the <I>missing value default</I>.</P><P>If an enumerated attribute is specified, the attribute's value
  must be an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII case-insensitive</A> match for one of the
  given keywords that are not said to be non-conforming, with no
  leading or trailing whitespace.</P><P>When the attribute is specified, if its value is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
  case-insensitive</A> match for one of the given keywords then
  that keyword's state is the state that the attribute represents. If
  the attribute value matches none of the given keywords, but the
  attribute has an <I>invalid value default</I>, then the attribute
  represents that state. Otherwise, if the attribute value matches
  none of the keywords but there is a <I>missing value default</I>
  state defined, then <EM>that</EM> is the state represented by the
  attribute. Otherwise, there is no default, and invalid values must
  be ignored.</P><P>When the attribute is <EM>not</EM> specified, if there is a
  <I>missing value default</I> state defined, then that is the state
  represented by the (missing) attribute. Otherwise, the absence of
  the attribute means that there is no state represented.</P><P class="note">The empty string can be a valid keyword.</P><H4 id="numbers"><SPAN class="secno">2.4.4 </SPAN>Numbers</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><H5 id="non-negative-integers"><SPAN class="secno">2.4.4.1 </SPAN>Non-negative integers</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A string is a <DFN id="valid-non-negative-integer">valid non-negative integer</DFN> if it
  consists of one or more characters in the range U+0030 DIGIT ZERO
  (0) to U+0039 DIGIT NINE (9).</P><P>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-non-negative-integer">valid non-negative integer</A> represents the number
  that is represented in base ten by that string of digits.</P><DIV class="impl">

  <P>The <DFN id="rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</DFN> are as
  given in the following algorithm. When invoked, the steps must be
  followed in the order given, aborting at the first step that returns
  a value. This algorithm will return either zero, a positive integer,
  or an error. Leading spaces are ignored. Trailing spaces and any
  trailing garbage characters are ignored.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A>.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</P></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is a U+002B PLUS SIGN character (+), advance <VAR title="">position</VAR> to the next character. (The "<CODE title="">+</CODE>" is ignored, but it is not conforming.)</P></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</P></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
   return an error.</P></LI>

   <!-- Ok. At this point we know we have a number. It might have
   trailing garbage which we'll ignore, but it's a number, and we
   won't return an error. -->

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
   resulting sequence as a base-ten integer. Let <VAR title="">value</VAR> be that integer.</P></LI>

   <LI><P>Return <VAR title="">value</VAR>.</P></LI>

  </OL></DIV><H5 id="signed-integers"><SPAN class="secno">2.4.4.2 </SPAN>Signed integers</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A string is a <DFN id="valid-integer">valid integer</DFN> if it consists of one or
  more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
  NINE (9), optionally prefixed with a U+002D HYPHEN-MINUS character
  (-).</P><P>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-integer">valid integer</A> without a U+002D HYPHEN-MINUS (-)
  prefix represents the number that is represented in base ten by that
  string of digits. A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-integer">valid integer</A> <EM>with</EM> a
  U+002D HYPHEN-MINUS (-) prefix represents the number represented in
  base ten by the string of digits that follows the U+002D
  HYPHEN-MINUS, subtracted from zero.</P><DIV class="impl">

  <P>The <DFN id="rules-for-parsing-integers">rules for parsing integers</DFN> are similar to the
  <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative integers">rules for
  non-negative integers</A>, and are as given in the following
  algorithm. When invoked, the steps must be followed in the order
  given, aborting at the first step that returns a value. This
  algorithm will return either an integer or an error. Leading spaces
  are ignored. Trailing spaces and trailing garbage characters are
  ignored.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P>Let <VAR title="">sign</VAR> have the value
   "positive".</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A>.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</P></LI>

   <LI>

    <P>If the character indicated by <VAR title="">position</VAR> (the
    first character) is a U+002D HYPHEN-MINUS character (-):</P>

    <OL><LI>Let <VAR title="">sign</VAR> be "negative".</LI>

     <LI>Advance <VAR title="">position</VAR> to the next
     character.</LI>

     <LI>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</LI>

    </OL><P>Otherwise, if the character indicated by <VAR title="">position</VAR> (the first character) is a U+002B PLUS
    SIGN character (+):</P>

    <OL><LI>Advance <VAR title="">position</VAR> to the next
     character. (The "<CODE title="">+</CODE>" is ignored, but it is
     not conforming.)</LI>

     <LI>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</LI>

    </OL></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
   return an error.</P></LI>

   <!-- Ok. At this point we know we have a number. It might have
   trailing garbage which we'll ignore, but it's a number, and we
   won't return an error. -->

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
   resulting sequence as a base-ten integer. Let <VAR title="">value</VAR> be that integer.</P></LI>

   <LI><P>If <VAR title="">sign</VAR> is "positive", return <VAR title="">value</VAR>, otherwise return the result of subtracting
   <VAR title="">value</VAR> from zero.</P></LI>

  </OL></DIV><H5 id="real-numbers"><SPAN class="secno">2.4.4.3 </SPAN>Real numbers</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A string is a <DFN id="valid-floating-point-number">valid floating point number</DFN> if it
  consists of:</P><OL class="brief"><LI>Optionally, a U+002D HYPHEN-MINUS character (-).</LI>

   <LI>A series of one or more characters in the range U+0030 DIGIT
   ZERO (0) to U+0039 DIGIT NINE (9).</LI>

   <LI>Optionally:

    <OL><LI>A single U+002E FULL STOP character (.).</LI>

     <LI>A series of one or more characters in the range U+0030 DIGIT
     ZERO (0) to U+0039 DIGIT NINE (9).</LI>

    </OL></LI>

   <LI>Optionally:

    <OL><LI>Either a U+0065 LATIN SMALL LETTER E character (e) or a
     U+0045 LATIN CAPITAL LETTER E character (E).</LI>

     <LI>Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B
     PLUS SIGN character (+).</LI>

     <LI>A series of one or more characters in the range U+0030 DIGIT
     ZERO (0) to U+0039 DIGIT NINE (9).</LI>

    </OL></LI>

  </OL><P>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-floating-point-number">valid floating point number</A> represents the number
  obtained by multiplying the significand by ten raised to the power
  of the exponent, where the significand is the first number,
  interpreted as base ten (including the decimal point and the number
  after the decimal point, if any, and interpreting the significand as
  a negative number if the whole string starts with a U+002D
  HYPHEN-MINUS character (-) and the number is not zero), and where
  the exponent is the number after the E, if any (interpreted as a
  negative number if there is a U+002D HYPHEN-MINUS character (-)
  between the E and the number and the number is not zero, or else
  ignoring a U+002B PLUS SIGN character (+) between the E and the
  number if there is one). If there is no E, then the exponent is
  treated as zero.</P><P class="note">The Infinity and Not-a-Number (NaN) values are not
  <A href="http://dev.w3.org/html5/spec/Overview.html#valid-floating-point-number" title="valid floating point number">valid floating point
  numbers</A>.</P><DIV class="impl">

  <P>The <DFN id="best-representation-of-the-number-as-a-floating-point-number" title="best representation of the number as a floating
  point number">best representation of the number <VAR title="">n</VAR> as a floating point number</DFN> is the string
  obtained from applying the JavaScript operator ToString to <VAR title="">n</VAR>. The JavaScript operator ToString is not uniquely
  determined. When there are multiple possible strings that could be
  obtained from the JavaScript operator ToString for a particular
  value, the user agent must always return the same string for that
  value (though it may differ from the value used by other user
  agents).</P>

  <P>The <DFN id="rules-for-parsing-floating-point-number-values">rules for parsing floating point number values</DFN> are
  as given in the following algorithm. This algorithm must be aborted
  at the first step that returns something. This algorithm will return
  either a number or an error. Leading spaces are ignored. Trailing
  spaces and garbage characters are ignored.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P>Let <VAR title="">value</VAR> have the value 1.</P></LI>

   <LI><P>Let <VAR title="">divisor</VAR> have the value 1.</P></LI>

   <LI><P>Let <VAR title="">exponent</VAR> have the value 1.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A>.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</P></LI>

   <LI>

    <P>If the character indicated by <VAR title="">position</VAR> is a
    U+002D HYPHEN-MINUS character (-):</P>

    <OL><LI>Change <VAR title="">value</VAR> and <VAR title="">divisor</VAR> to −1.</LI>

     <LI>Advance <VAR title="">position</VAR> to the next
     character.</LI>

     <LI>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</LI>

    </OL></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
   return an error.</P></LI>

   <!-- Ok. At this point we know we have a number. It might have
   trailing garbage which we'll ignore, but it's a number, and we
   won't return an error unless it's out of range. -->

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
   resulting sequence as a base-ten integer. Multiply <VAR title="">value</VAR> by that integer.</P></LI>

   <LI>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, jump to the step labeled
   <I>conversion</I>.</LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is a U+002E FULL STOP (.), run these substeps:</P>

    <OL><LI><P>Advance <VAR title="">position</VAR> to the next
     character.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, or if the character indicated by <VAR title="">position</VAR> is not one of U+0030 DIGIT ZERO (0) to
     U+0039 DIGIT NINE (9), then jump to the step labeled
     <I>conversion</I>.</P></LI>

     <LI><P><I>Fraction loop</I>: Multiply <VAR title="">divisor</VAR>
     by ten.</P></LI>

     <LI>Add the value of the character indicated by <VAR title="">position</VAR>, interpreted as a base-ten digit (0..9)
     and divided by <VAR title="">divisor</VAR>, to <VAR title="">value</VAR>.</LI>

     <LI><P>Advance <VAR title="">position</VAR> to the next
     character.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, then jump to the step labeled
     <I>conversion</I>.</P></LI>

     <LI><P>If the character indicated by <VAR title="">position</VAR>
     is one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), jump
     back to the step labeled <I>fraction loop</I> in these
     substeps.</P></LI>

    </OL></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN
   CAPITAL LETTER E character (E), run these substeps:</P>

    <OL><LI><P>Advance <VAR title="">position</VAR> to the next
     character.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, then jump to the step labeled
     <I>conversion</I>.</P></LI>

     <LI>

      <P>If the character indicated by <VAR title="">position</VAR> is
      a U+002D HYPHEN-MINUS character (-):</P>

      <OL><LI>Change <VAR title="">exponent</VAR> to −1.</LI>

       <LI>Advance <VAR title="">position</VAR> to the next
       character.</LI>

       <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, then jump to the step labeled
       <I>conversion</I>.</P></LI>

      </OL><P>Otherwise, if the character indicated by <VAR title="">position</VAR> is a U+002B PLUS SIGN character (+):</P>

      <OL><LI>Advance <VAR title="">position</VAR> to the next
       character.</LI>

       <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, then jump to the step labeled
       <I>conversion</I>.</P></LI>

      </OL></LI>

     <LI><P>If the character indicated by <VAR title="">position</VAR>
     is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
     then jump to the step labeled <I>conversion</I>.</P></LI>

     <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
     U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
     resulting sequence as a base-ten integer. Multiply <VAR title="">exponent</VAR> by that integer.</P></LI>

     <LI><P>Multiply <VAR title="">value</VAR> by ten raised to the
     <VAR title="">exponent</VAR>th power.</P></LI>

    </OL></LI>

   <LI><P><I>Conversion</I>: Let <VAR title="">S</VAR> be the set of
   finite IEEE 754 single-precision floating point values except
   −0, but with two special values added: 2<SUP title="">128</SUP> and −2<SUP title="">128</SUP>.</P></LI>

   <LI><P>Let <VAR title="">rounded-value</VAR> be the number in <VAR title="">S</VAR> that is closest to <VAR title="">value</VAR>,
   selecting the number with an even significand if there are two
   equally close values. (The two special values 2<SUP title="">128</SUP> and −2<SUP title="">128</SUP> are
   considered to have even significands for this purpose.)</P></LI>

   <LI><P>If <VAR title="">rounded-value</VAR> is 2<SUP title="">128</SUP> or −2<SUP title="">128</SUP>, return an
   error.</P></LI>

   <LI><P>Return <VAR title="">rounded-value</VAR>.</P></LI>

  </OL></DIV><DIV class="impl">
  <H5 id="percentages-and-dimensions"><SPAN class="secno">2.4.4.4 </SPAN>Percentages and lengths</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>
<!--(percentages are not used in valid html anymore)
  <p>A string is a <dfn>valid dimension value</dfn> if it consists of
  a character in the range U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE
  (9), optionally followed by zero of more characters in the range
  U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), optionally followed
  by a U+002E FULL STOP character (.) and one or more characters in
  the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and
  optionally suffixed by a U+0025 PERCENT SIGN character (%).</p>

  <p>A <span>valid dimension value</span> represents the number that
  is represented in base ten by that string of digits, optionally with
  a fractional component. If the U+0025 PERCENT SIGN is present, then
  the dimension is a percentage; otherwise, it is a length.</p>

  <p class="note">For historical reasons, percentanges and lengths
  less than 1.0 cannot be represented as <span title="valid dimension
  value">valid dimension values</span>.</p>
-->
  <P>The <DFN id="rules-for-parsing-dimension-values">rules for parsing dimension values</DFN> are as given in
  the following algorithm. When invoked, the steps must be followed in
  the order given, aborting at the first step that returns a
  value. This algorithm will return either a number greater than or
  equal to 1.0, or an error; if a number is returned, then it is
  further categorized as either a percentage or a length.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A>.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</P></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is a U+002B PLUS SIGN character (+), advance <VAR title="">position</VAR> to the next character.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> that are
   U+0030 DIGIT ZERO (0) characters, and discard them.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return an error.</P></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is not one of U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE (9), then
   return an error.</P></LI>

   <!-- Ok. At this point we know we have a number. It might have
   trailing garbage which we'll ignore, but it's a number, and we
   won't return an error. -->

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
   resulting sequence as a base-ten integer. Let <VAR title="">value</VAR> be that number.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return <VAR title="">value</VAR> as a
   length.</P></LI>

   <LI>

    <P>If the character indicated by <VAR title="">position</VAR> is a
    U+002E FULL STOP character (.):</P>

    <OL><LI><P>Advance <VAR title="">position</VAR> to the next
     character.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, or if the character indicated by <VAR title="">position</VAR> is not one of U+0030 DIGIT ZERO (0) to
     U+0039 DIGIT NINE (9), then return <VAR title="">value</VAR> as a
     length.</P></LI>

     <LI><P>Let <VAR title="">divisor</VAR> have the value 1.</P></LI>

     <LI><P><I>Fraction loop</I>: Multiply <VAR title="">divisor</VAR>
     by ten.</P></LI>

     <LI>Add the value of the character indicated by <VAR title="">position</VAR>, interpreted as a base-ten digit (0..9)
     and divided by <VAR title="">divisor</VAR>, to <VAR title="">value</VAR>.</LI>

     <LI><P>Advance <VAR title="">position</VAR> to the next
     character.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, then return <VAR title="">value</VAR> as a
     length.</P></LI>

     <LI><P>If the character indicated by <VAR title="">position</VAR>
     is one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), return
     to the step labeled <I>fraction loop</I> in these
     substeps.</P></LI>

    </OL></LI>

   <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, return <VAR title="">value</VAR> as a
   length.</P></LI>

   <LI><P>If the character indicated by <VAR title="">position</VAR>
   is a U+0025 PERCENT SIGN character (%), return <VAR title="">value</VAR> as a percentage.</P></LI>

   <LI><P>Return <VAR title="">value</VAR> as a length.</P></LI>

  </OL></DIV><H5 id="lists-of-integers"><SPAN class="secno">2.4.4.5 </SPAN>Lists of integers</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="valid-list-of-integers">valid list of integers</DFN> is a number of <A href="http://dev.w3.org/html5/spec/Overview.html#valid-integer" title="valid integer">valid integers</A> separated by U+002C
  COMMA characters, with no other characters (e.g. no <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>). In addition, there
  might be restrictions on the number of integers that can be given,
  or on the range of values allowed.</P><DIV class="impl">

  <P>The <DFN id="rules-for-parsing-a-list-of-integers">rules for parsing a list of integers</DFN> are as
  follows:</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P>Let <VAR title="">numbers</VAR> be an initially empty list
   of integers. This list will be the result of this
   algorithm.</P></LI>

   <LI><P>If there is a character in the string <VAR title="">input</VAR> at position <VAR title="">position</VAR>, and
   it is either a U+0020 SPACE, U+002C COMMA, or U+003B SEMICOLON
   character, then advance <VAR title="">position</VAR> to the next
   character in <VAR title="">input</VAR>, or to beyond the end of the
   string if there are no more characters.</P></LI>

   <LI><P>If <VAR title="">position</VAR> points to beyond the end of
   <VAR title="">input</VAR>, return <VAR title="">numbers</VAR> and
   abort.</P></LI>

   <LI><P>If the character in the string <VAR title="">input</VAR> at
   position <VAR title="">position</VAR> is a U+0020 SPACE, U+002C
   COMMA, or U+003B SEMICOLON character, then return to step 4.</P></LI>

   <LI><P>Let <VAR title="">negated</VAR> be false.</P></LI>
   <LI><P>Let <VAR title="">value</VAR> be 0.</P></LI>

   <LI><P>Let <VAR title="">started</VAR> be false. This variable is
   set to true when the parser sees a number or a U+002D HYPHEN-MINUS
   character (-).</P></LI>

   <LI><P>Let <VAR title="">got number</VAR> be false. This variable
   is set to true when the parser sees a number.</P></LI>

   <LI><P>Let <VAR title="">finished</VAR> be false. This variable is
   set to true to switch parser into a mode where it ignores
   characters until the next separator.</P></LI>

   <LI><P>Let <VAR title="">bogus</VAR> be false.</P></LI>

   <LI><P><I>Parser</I>: If the character in the string <VAR title="">input</VAR> at position <VAR title="">position</VAR>
   is:</P>

    <DL class="switch"><DT>A U+002D HYPHEN-MINUS character</DT>

     <DD>

      <P>Follow these substeps:</P>

      <OL><LI>If <VAR title="">got number</VAR> is true, let <VAR title="">finished</VAR> be true.</LI>

       <LI>If <VAR title="">finished</VAR> is true, skip to the next
       step in the overall set of steps.</LI>

       <LI>If <VAR title="">started</VAR> is true, let <VAR title="">negated</VAR> be false.</LI>

       <LI>Otherwise, if <VAR title="">started</VAR> is false and if <VAR title="">bogus</VAR> is false, let <VAR title="">negated</VAR>
       be true.</LI>

       <LI>Let <VAR title="">started</VAR> be true.</LI>

      </OL></DD>


     <DT>A character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
     NINE (9)</DT>

     <DD>

      <P>Follow these substeps:</P>

      <OL><LI>If <VAR title="">finished</VAR> is true, skip to the next
       step in the overall set of steps.</LI>

       <LI>Multiply <VAR title="">value</VAR> by ten.</LI>

       <LI>Add the value of the digit, interpreted in base ten, to
       <VAR title="">value</VAR>.</LI>

       <LI>Let <VAR title="">started</VAR> be true.</LI>

       <LI>Let <VAR title="">got number</VAR> be true.</LI>

      </OL></DD>


     <DT>A U+0020 SPACE character</DT>
     <DT>A U+002C COMMA character</DT>
     <DT>A U+003B SEMICOLON character</DT>

     <DD>

      <P>Follow these substeps:</P>

      <OL><LI>If <VAR title="">got number</VAR> is false, return the <VAR title="">numbers</VAR> list and abort. This happens if an entry
       in the list has no digits, as in "<CODE title="">1,2,x,4</CODE>".</LI>

       <LI>If <VAR title="">negated</VAR> is true, then negate <VAR title="">value</VAR>.</LI>

       <LI>Append <VAR title="">value</VAR> to the <VAR title="">numbers</VAR> list.</LI>

       <LI>Jump to step 4 in the overall set of steps.</LI>

      </OL></DD>


     <!-- <dt>A U+002E FULL STOP character</dt> -->
     <DT>A character in the range U+0001 to U+001F, <!-- space --> U+0021 to U+002B, <!-- comma --> U+002D to U+002F, <!-- digits --> U+003A, <!-- semicolon --> U+003C to U+0040, <!-- a-z --> U+005B to U+0060, <!-- A-Z --> U+007b to U+007F
        (i.e. any other non-alphabetic ASCII character)</DT>

 <!--
 Test: http://www.hixie.ch/tests/adhoc/html/flow/image-maps/004-demo.html
 IE6 on Wine treats the following characters like this also: U+1-U+1f,
 U+21-U+2b, U+2d-U+2f, U+3a, U+3c-U+40, U+5b-U+60, U+7b-U+82,
 U+84-U+89, U+8b, U+8d, U+8f-U+99, U+9b, U+9d, U+a0-U+bf, U+d7, U+f7,
 U+1f6-U+1f9, U+218-U+24f, U+2a9-U+385, U+387, U+38b, U+38d, U+3a2,
 U+3cf, U+3d7-U+3d9, U+3db, U+3dd, U+3df, U+3e1, U+3f4-U+400, U+40d,
 U+450, U+45d, U+482-U+48f, U+4c5-U+4c6, U+4c9-U+4ca, U+4cd-U+4cf,
 U+4ec-U+4ed, U+4f6-U+4f7, U+4fa-U+530, U+557-U+560, U+588-U+5cf,
 U+5eb-U+5ef, U+5f3-U+620, U+63b-U+640, U+64b-U+670, U+6b8-U+6b9,
 U+6bf, U+6cf, U+6d4, U+6d6-U+904, U+93a-U+957, U+962-U+984,
 U+98d-U+98e, U+991-U+992, U+9a9, U+9b1, U+9b3-U+9b5, U+9ba-U+9db,
 U+9de, U+9e2-U+9ef, U+9f2-U+a04, U+a0b-U+a0e, U+a11-U+a12, U+a29,
 U+a31, U+a34, U+a37, U+a3a-U+a58, U+a5d, U+a5f-U+a84, U+a8c, U+a8e,
 U+a92, U+aa9, U+ab1, U+ab4, U+aba-U+adf, U+ae1-U+b04, U+b0d-U+b0e,
 U+b11-U+b12, U+b29, U+b31, U+b34-U+b35, U+b3a-U+b5b, U+b5e,
 U+b62-U+b84, U+b8b-U+b8d, U+b91, U+b96-U+b98, U+b9b, U+b9d,
 U+ba0-U+ba2, U+ba5-U+ba7, U+bab-U+bad, U+bb6, U+bba-U+c04, U+c0d,
 U+c11, U+c29, U+c34, U+c3a-U+c5f, U+c62-U+c84, U+c8d, U+c91, U+ca9,
 U+cb4, U+cba-U+cdd, U+cdf, U+ce2-U+d04, U+d0d, U+d11, U+d29,
 U+d3a-U+d5f, U+d62-U+e00, U+e2f, U+e31, U+e34-U+e3f, U+e46-U+e80,
 U+e83, U+e85-U+e86, U+e89, U+e8b-U+e8c, U+e8e-U+e93, U+e98, U+ea0,
 U+ea4, U+ea6, U+ea8-U+ea9, U+eac, U+eaf-U+edb, U+ede-U+109f,
 U+10c6-U+10cf, U+10f7-U+10ff, U+115a-U+115e, U+11a3-U+11a7,
 U+11fa-U+1dff, U+1e9b-U+1e9f, U+1efa-U+1eff, U+1f16-U+1f17,
 U+1f1e-U+1f1f, U+1f46-U+1f47, U+1f4e-U+1f4f, U+1f58, U+1f5a, U+1f5c,
 U+1f5e, U+1f7e-U+1f7f, U+1fb5, U+1fbd-U+1fc1, U+1fc5, U+1fcd-U+1fcf,
 U+1fd4-U+1fd5, U+1fdc-U+1fdf, U+1fed-U+1ff1, U+1ff5, U+1ffd-U+249b,
 U+24ea-U+3004, U+3006-U+3040, U+3095-U+309a, U+309f-U+30a0, U+30fb,
 U+30ff-U+3104, U+312d-U+3130, U+318f-U+4dff, U+9fa6-U+abff,
 U+d7a4-U+d7ff, U+e000-U+f8ff, U+fa2e-U+faff, U+fb07-U+fb12,
 U+fb18-U+fb1e, U+fb37, U+fb3d, U+fb3f, U+fb42, U+fb45, U+fbb2-U+fbd2,
 U+fbe9, U+fce1, U+fd3e-U+fd4f, U+fd90-U+fd91, U+fdc8-U+fdef,
 U+fdfc-U+fe7f, U+fefd-U+ff20, U+ff3b-U+ff40, U+ff5b-U+ff65, U+ffa0,
 U+ffbf-U+ffc1, U+ffc8-U+ffc9, U+ffd0-U+ffd1, U+ffd8-U+ffd9,
 U+ffdd-U+ffff
 IE7 on Win2003 treats the following characters like this also
 instead: U+1-U+1f, U+21-U+2b, U+2d-U+2f, U+3a, U+3c-U+40, U+5b-U+60,
 U+7b-U+82, U+84-U+89, U+8b, U+8d, U+8f-U+99, U+9b, U+9d, U+a0-U+a9,
 U+ab-U+b4, U+b6-U+b9, U+bb-U+bf, U+d7, U+f7, U+220-U+221,
 U+234-U+24f, U+2ae-U+2af, U+2b9-U+2ba, U+2c2-U+2df, U+2e5-U+2ed,
 U+2ef-U+344, U+346-U+379, U+37b-U+385, U+387, U+38b, U+38d, U+3a2,
 U+3cf, U+3d8-U+3d9, U+3f4-U+3ff, U+482-U+48b, U+4c5-U+4c6,
 U+4c9-U+4ca, U+4cd-U+4cf, U+4f6-U+4f7, U+4fa-U+530, U+557-U+558,
 U+55a-U+560, U+588-U+5cf, U+5eb-U+5ef, U+5f3-U+620, U+63b-U+640,
 U+656-U+66f, U+6d4, U+6dd-U+6e0, U+6e9-U+6ec, U+6ee-U+6f9,
 U+6fd-U+70f, U+72d-U+72f, U+740-U+77f, U+7b1-U+900, U+904,
 U+93a-U+93c, U+94d - U+94f, U+951-U+957, U+964-U+980, U+984,
 U+98d-U+98e, U+991-U+992, U+9a9, U+9b1, U+9b3-U+9b5, U+9ba-U+9bd,
 U+9c5-U+9c6, U+9c9-U+9ca, U+9cd-U+9d6, U+9d8-U+9db, U+9de,
 U+9e4-U+9ef, U+9f2-U+a01, U+a03-U+a04, U+a0b-U+a0e, U+a11-U+a12,
 U+a29, U+a31, U+a34, U+a37, U+a3a-U+a3d, U+a43-U+a46, U+a49-U+a4a,
 U+a4d-U+a58, U+a5d, U+a5f-U+a6f, U+a75-U+a80, U+a84, U+a8c, U+a8e,
 U+a92, U+aa9, U+ab1, U+ab4, U+aba-U+abc, U+ac6, U+aca, U+acd-U+acf,
 U+ad1-U+adf, U+ae1-U+b00, U+b04, U+b0d-U+b0e, U+b11-U+b12, U+b29,
 U+b31, U+b34-U+b35, U+b3a-U+b3c, U+b44-U+b46, U+b49 - U+b4a,
 U+b4d-U+b55, U+b58-U+b5b, U+b5e, U+b62-U+b81, U+b84, U+b8b-U+b8d,
 U+b91, U+b96-U+b98, U+b9b, U+b9d, U+ba0 - U+ba2, U+ba5-U+ba7,
 U+bab-U+bad, U+bb6, U+bba-U+bbd, U+bc3-U+bc5, U+bc9, U+bcd-U+bd6,
 U+bd8-U+c00, U+c04, U+c0d, U+c11, U+c29, U+c34, U+c3a-U+c3d, U+c45,
 U+c49, U+c4d-U+c54, U+c57-U+c5f, U+c62-U+c81, U+c84, U+c8d, U+c91,
 U+ca9, U+cb4, U+cba-U+cbd, U+cc5, U+cc9, U+ccd-U+cd4, U+cd7-U+cdd,
 U+cdf, U+ce2-U+d01, U+d04, U+d0d, U+d11, U+d29, U+d3a-U+d3d,
 U+d44-U+d45, U+d49, U+d4d-U+d56, U+d58-U+d5f, U+d62-U+d81, U+d84,
 U+d97-U+d99, U+db2, U+dbc, U+dbe - U+dbf, U+dc7-U+dce, U+dd5, U+dd7,
 U+de0-U+df1, U+df4-U+e00, U+e3b-U+e3f, U+e4f-U+e80, U+e83,
 U+e85-U+e86, U+e89, U+e8b-U+e8c, U+e8e-U+e93, U+e98, U+ea0, U+ea4,
 U+ea6, U+ea8-U+ea9, U+eac, U+eba, U+ebe-U+ebf, U+ec5-U+ecc,
 U+ece-U+edb, U+ede-U+eff, U+f01-U+f3f, U+f48, U+f6b-U+f70,
 U+f82-U+f87, U+f8c-U+f8f, U+f98, U+fbd-U+fff, U+1022, U+1028, U+102b,
 U+1033-U+1035, U+1037, U+1039-U+104f, U+105a-U+109f, U+10c6-U+10cf,
 U+10f7-U+10ff, U+115a - U+115e, U+11a3-U+11a7, U+11fa-U+11ff, U+1207,
 U+1247, U+1249, U+124e-U+124f, U+1257, U+1259, U+125e-U+125f, U+1287,
 U+1289, U+128e-U+128f, U+12af, U+12b1, U+12b6-U+12b7, U+12bf, U+12c1,
 U+12c6-U+12c7, U+12cf, U+12d7, U+12ef, U+130f, U+1311, U+1316-U+1317,
 U+131f, U+1347, U+135b-U+139f, U+13f5-U+1400, U+166d-U+166e,
 U+1677-U+1680, U+169b - U+169f, U+16eb-U+177f, U+17c9-U+181f, U+1843,
 U+1878-U+187f, U+18aa-U+1dff, U+1e9c-U+1e9f, U+1efa-U+1eff,
 U+1f16-U+1f17, U+1f1e-U+1f1f, U+1f46-U+1f47, U+1f4e-U+1f4f, U+1f58,
 U+1f5a, U+1f5c, U+1f5e, U+1f7e-U+1f7f, U+1fb5, U+1fbd, U+1fbf-U+1fc1,
 U+1fc5, U+1fcd-U+1fcf, U+1fd4-U+1fd5, U+1fdc-U+1fdf, U+1fed-U+1ff1,
 U+1ff5, U+1ffd-U+207e, U+2080-U+2101, U+2103-U+2106, U+2108-U+2109,
 U+2114, U+2116-U+2118, U+211e-U+2123, U+2125, U+2127, U+2129, U+212e,
 U+2132, U+213a-U+215f, U+2184-U+3005, U+3008-U+3020, U+302a-U+3037,
 U+303b-U+3104, U+312d-U+3130, U+318f - U+319f, U+31b8-U+33ff,
 U+4db6-U+4dff, U+9fa6-U+9fff, U+a48d-U+abff, U+d7a4-U+d7ff,
 U+e000-U+f8ff, U+fa2e-U+faff, U+fb07-U+fb12, U+fb18-U+fb1c, U+fb1e,
 U+fb29, U+fb37, U+fb3d, U+fb3f, U+fb42, U+fb45, U+fbb2-U+fbd2,
 U+fd3e-U+fd4f, U+fd90-U+fd91, U+fdc8-U+fdef, U+fdfc-U+fe6f, U+fe73,
 U+fe75, U+fefd-U+ff20, U+ff3b-U+ff40, U+ff5b-U+ff9f, U+ffbf-U+ffc1,
 U+ffc8-U+ffc9, U+ffd0-U+ffd1, U+ffd8-U+ffd9, U+ffdd-U+ffff
 -->

     <DD>

      <P>Follow these substeps:</P>

      <OL><LI>If <VAR title="">got number</VAR> is true, let <VAR title="">finished</VAR> be true.</LI>

       <LI>If <VAR title="">finished</VAR> is true, skip to the next
       step in the overall set of steps.</LI>

       <LI>Let <VAR title="">negated</VAR> be false.</LI>

      </OL></DD>


     <DT>Any other character</DT>
     <!-- alphabetic a-z A-Z, and non-ASCII -->

     <DD>

      <P>Follow these substeps:</P>

      <OL><LI>If <VAR title="">finished</VAR> is true, skip to the next
       step in the overall set of steps.</LI>

       <LI>Let <VAR title="">negated</VAR> be false.</LI>

       <LI>Let <VAR title="">bogus</VAR> be true.</LI>

       <LI>If <VAR title="">started</VAR> is true, then return the
       <VAR title="">numbers</VAR> list, and abort. (The value in <VAR title="">value</VAR> is not appended to the list first; it is
       dropped.)</LI>

      </OL></DD>

    </DL></LI>

   <LI><P>Advance <VAR title="">position</VAR> to the next character
   in <VAR title="">input</VAR>, or to beyond the end of the string if
   there are no more characters.</P></LI>

   <LI><P>If <VAR title="">position</VAR> points to a character (and
   not to beyond the end of <VAR title="">input</VAR>), jump to the
   big <I>Parser</I> step above.</P></LI>

   <LI><P>If <VAR title="">negated</VAR> is true, then negate <VAR title="">value</VAR>.</P></LI>

   <LI><P>If <VAR title="">got number</VAR> is true, then append <VAR title="">value</VAR> to the <VAR title="">numbers</VAR> list.</P></LI>

   <LI><P>Return the <VAR title="">numbers</VAR> list and
   abort.</P></LI>

  </OL></DIV><DIV class="impl">

  <H5 id="lists-of-dimensions"><SPAN class="secno">2.4.4.6 </SPAN>Lists of dimensions</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <!-- no definition of a type since no conforming feature uses this
  syntax (it's only used in cols="" and rows="" on <frameset> -->

  <P>The <DFN id="rules-for-parsing-a-list-of-dimensions">rules for parsing a list of dimensions</DFN> are as
  follows. These rules return a list of zero or more pairs consisting
  of a number and a unit, the unit being one of <I>percentage</I>,
  <I>relative</I>, and <I>absolute</I>.</P>

  <OL><LI><P>Let <VAR title="">raw input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>If the last character in <VAR title="">raw input</VAR> is a
   U+002C COMMA character (,), then remove that character from <VAR title="">raw input</VAR>.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-commas" title="split a string on commas">Split the string <VAR title="">raw input</VAR> on commas</A>. Let <VAR title="">raw
   tokens</VAR> be the resulting list of tokens.</P></LI>

   <LI><P>Let <VAR title="">result</VAR> be an empty list of
   number/unit pairs.</P></LI>

   <LI>

    <P>For each token in <VAR title="">raw tokens</VAR>, run the
    following substeps:</P>

    <OL><LI><P>Let <VAR title="">input</VAR> be the token.</P></LI>

     <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
     string.</P></LI>

     <LI><P>Let <VAR title="">value</VAR> be the number 0.</P></LI>

     <LI><P>Let <VAR title="">unit</VAR> be <I>absolute</I>.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is past the end of <VAR title="">input</VAR>, set <VAR title="">unit</VAR> to
     <I>relative</I> and jump to the last substep.</P></LI>

     <LI><P>If the character at <VAR title="">position</VAR> is a
     character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
     (9), <A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">collect a sequence of characters</A> in the range
     U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), interpret the
     resulting sequence as an integer in base ten, and increment <VAR title="">value</VAR> by that integer.</P></LI>

     <LI>

      <P>If the character at <VAR title="">position</VAR> is a U+002E
      FULL STOP character (.), run these substeps:</P>

      <OL><LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> consisting
       of <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A> and
       characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
       NINE (9). Let <VAR title="">s</VAR> be the resulting
       sequence.</P></LI>

       <LI><P>Remove all <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space
       characters</A> in <VAR title="">s</VAR>.</P></LI>

       <LI>

        <P>If <VAR title="">s</VAR> is not the empty string, run these
        subsubsteps:</P>

        <OL><LI><P>Let <VAR title="">length</VAR> be the number of
         characters in <VAR title="">s</VAR> (after the spaces were
         removed).</P></LI>

         <LI><P>Let <VAR title="">fraction</VAR> be the result of
         interpreting <VAR title="">s</VAR> as a base-ten integer, and
         then dividing that number by <SPAN title="">10<SUP title=""><VAR title="">length</VAR></SUP></SPAN>.</P></LI>

         <LI><P>Increment <VAR title="">value</VAR> by <VAR title="">fraction</VAR>.</P></LI>

        </OL></LI>

      </OL></LI>

     <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A>.</P></LI>

     <LI>

      <P>If the character at <VAR title="">position</VAR> is a U+0025
      PERCENT SIGN character (%), then set <VAR title="">unit</VAR> to
      <I>percentage</I>.</P>

      <P>Otherwise, if the character at <VAR title="">position</VAR>
      is a U+002A ASTERISK character (*), then set <VAR title="">unit</VAR> to <I>relative</I>.</P>

     </LI>

     <!-- the remaining characters in /input/ are ignored -->

     <LI><P>Add an entry to <VAR title="">result</VAR> consisting of
     the number given by <VAR title="">value</VAR> and the unit given
     by <VAR title="">unit</VAR>.</P></LI>

    </OL></LI>

   <LI><P>Return the list <VAR title="">result</VAR>.</P></LI>

  </OL></DIV><H4 id="dates-and-times"><SPAN class="secno">2.4.5 </SPAN>Dates and times</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>In the algorithms below, the <DFN id="number-of-days-in-month-month-of-year-year">number of days in month <VAR title="">month</VAR> of year <VAR title="">year</VAR></DFN> is:
  <EM>31</EM> if <VAR title="">month</VAR> is 1, 3, 5, 7, 8, 10, or
  12; <EM>30</EM> if <VAR title="">month</VAR> is 4, 6, 9, or 11;
  <EM>29</EM> if <VAR title="">month</VAR> is 2 and <VAR title="">year</VAR> is a number divisible by 400, or if <VAR title="">year</VAR> is a number divisible by 4 but not by 100; and
  <EM>28</EM> otherwise. This takes into account leap years in the
  Gregorian calendar. <A href="http://dev.w3.org/html5/spec/Overview.html#refsGREGORIAN">[GREGORIAN]</A></P><P>The <DFN id="concept-datetime-digit" title="concept-datetime-digit">digits</DFN> in the date
  and time syntaxes defined in this section must be characters in the
  range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), used to
  express numbers in base ten.</P><DIV class="impl">

  <P class="note">While the formats described here are intended to be
  subsets of the corresponding ISO8601 formats, this specification
  defines parsing rules in much more detail than ISO8601.
  Implementors are therefore encouraged to carefully examine any date
  parsing libraries before using them to implement the parsing rules
  described below; ISO8601 libraries might not parse dates and times
  in exactly the same manner. <A href="http://dev.w3.org/html5/spec/Overview.html#refsISO8601">[ISO8601]</A></P>

  </DIV><H5 id="months"><SPAN class="secno">2.4.5.1 </SPAN>Months</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="concept-month" title="concept-month">month</DFN> consists of a specific
  proleptic Gregorian date with no time-zone information and no date
  information beyond a year and a month. <A href="http://dev.w3.org/html5/spec/Overview.html#refsGREGORIAN">[GREGORIAN]</A></P><P>A string is a <DFN id="valid-month-string">valid month string</DFN> representing a year
  <VAR title="">year</VAR> and month <VAR title="">month</VAR> if it
  consists of the following components in the given order:</P><OL><LI>Four or more <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>, representing <VAR title="">year</VAR>, where <VAR title="">year</VAR>&nbsp;&gt;&nbsp;0</LI>

   <LI>A U+002D HYPHEN-MINUS character (-)</LI>

   <LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
   representing the month <VAR title="">month</VAR>, in the range
   1&nbsp;≤&nbsp;<VAR title="">month</VAR>&nbsp;≤&nbsp;12</LI>

  </OL><DIV class="impl">

  <P>The rules to <DFN id="parse-a-month-string">parse a month string</DFN> are as follows. This
  will return either a year and month, or nothing. If at any point the
  algorithm says that it "fails", this means that it is aborted at
  that point and returns nothing.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-month-component">Parse a month component</A> to obtain <VAR title="">year</VAR> and <VAR title="">month</VAR>. If this returns
   nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is <EM>not</EM> beyond the
   end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P>Return <VAR title="">year</VAR> and <VAR title="">month</VAR>.</P></LI>

  </OL><P>The rules to <DFN id="parse-a-month-component">parse a month component</DFN>, given an <VAR title="">input</VAR> string and a <VAR title="">position</VAR>, are
  as follows. This will return either a year and a month, or
  nothing. If at any point the algorithm says that it "fails", this
  means that it is aborted at that point and returns nothing.</P>

  <OL><LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
   sequence is not at least four characters long, then
   fail. Otherwise, interpret the resulting sequence as a base-ten
   integer. Let that number be the <VAR title="">year</VAR>.</P></LI>

   <LI><P>If <VAR title="">year</VAR> is not a number greater than
   zero, then fail.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+002D HYPHEN-MINUS character,
   then fail. Otherwise, move <VAR title="">position</VAR> forwards
   one character.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
   sequence is not exactly two characters long, then fail. Otherwise,
   interpret the resulting sequence as a base-ten integer. Let that
   number be the <VAR title="">month</VAR>.</P></LI>

   <LI><P>If <VAR title="">month</VAR> is not a number in the range
   1&nbsp;≤&nbsp;<VAR title="">month</VAR>&nbsp;≤&nbsp;12, then
   fail.</P></LI>

   <LI><P>Return <VAR title="">year</VAR> and <VAR title="">month</VAR>.</P></LI>

  </OL></DIV><H5 id="dates"><SPAN class="secno">2.4.5.2 </SPAN>Dates</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="concept-date" title="concept-date">date</DFN> consists of a specific
  proleptic Gregorian date with no time-zone information, consisting
  of a year, a month, and a day. <A href="http://dev.w3.org/html5/spec/Overview.html#refsGREGORIAN">[GREGORIAN]</A></P><P>A string is a <DFN id="valid-date-string">valid date string</DFN> representing a year
  <VAR title="">year</VAR>, month <VAR title="">month</VAR>, and day
  <VAR title="">day</VAR> if it consists of the following components
  in the given order:</P><OL><LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-month-string">valid month string</A>, representing <VAR title="">year</VAR> and <VAR title="">month</VAR></LI>

   <LI>A U+002D HYPHEN-MINUS character (-)</LI>

   <LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
   representing <VAR title="">day</VAR>, in the range
   1&nbsp;≤&nbsp;<VAR title="">day</VAR>&nbsp;≤&nbsp;<VAR title="">maxday</VAR> where <VAR title="">maxday</VAR> is the <A href="http://dev.w3.org/html5/spec/Overview.html#number-of-days-in-month-month-of-year-year" title="number of days in month month of year year">number of days
   in the month <VAR title="">month</VAR> and year <VAR title="">year</VAR></A></LI>

  </OL><DIV class="impl">

  <P>The rules to <DFN id="parse-a-date-string">parse a date string</DFN> are as follows. This
  will return either a date, or nothing. If at any point the algorithm
  says that it "fails", this means that it is aborted at that point
  and returns nothing.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-date-component">Parse a date component</A> to obtain <VAR title="">year</VAR>, <VAR title="">month</VAR>, and <VAR title="">day</VAR>. If this returns nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is <EM>not</EM> beyond the
   end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P>Let <VAR title="">date</VAR> be the date with year <VAR title="">year</VAR>, month <VAR title="">month</VAR>, and day <VAR title="">day</VAR>.</P></LI>

   <LI><P>Return <VAR title="">date</VAR>.</P></LI>

  </OL><P>The rules to <DFN id="parse-a-date-component">parse a date component</DFN>, given an <VAR title="">input</VAR> string and a <VAR title="">position</VAR>, are
  as follows. This will return either a year, a month, and a day, or
  nothing. If at any point the algorithm says that it "fails", this
  means that it is aborted at that point and returns nothing.</P>

  <OL><LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-month-component">Parse a month component</A> to obtain <VAR title="">year</VAR> and <VAR title="">month</VAR>. If this returns
   nothing, then fail.</P></LI>

   <LI><P>Let <VAR title="">maxday</VAR> be the <A href="http://dev.w3.org/html5/spec/Overview.html#number-of-days-in-month-month-of-year-year">number of days
   in month <VAR title="">month</VAR> of year <VAR title="">year</VAR></A>.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+002D HYPHEN-MINUS character,
   then fail. Otherwise, move <VAR title="">position</VAR> forwards
   one character.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
   sequence is not exactly two characters long, then fail. Otherwise,
   interpret the resulting sequence as a base-ten integer. Let that
   number be the <VAR title="">day</VAR>.</P></LI>

   <LI><P>If <VAR title="">day</VAR> is not a number in the range
   1&nbsp;≤&nbsp;<VAR title="">day</VAR>&nbsp;≤&nbsp;<VAR title="">maxday</VAR>, then fail.</P></LI>

   <LI><P>Return <VAR title="">year</VAR>, <VAR title="">month</VAR>,
   and <VAR title="">day</VAR>.</P></LI>

  </OL></DIV><H5 id="times"><SPAN class="secno">2.4.5.3 </SPAN>Times</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="concept-time" title="concept-time">time</DFN> consists of a specific
  time with no time-zone information, consisting of an hour, a minute,
  a second, and a fraction of a second.</P><P>A string is a <DFN id="valid-time-string">valid time string</DFN> representing an hour
  <VAR title="">hour</VAR>, a minute <VAR title="">minute</VAR>, and a
  second <VAR title="">second</VAR> if it consists of the following
  components in the given order:</P><OL><LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
   representing <VAR title="">hour</VAR>, in the range
   0&nbsp;≤&nbsp;<VAR title="">hour</VAR>&nbsp;≤&nbsp;23</LI>

   <LI>A U+003A COLON character (:)</LI>

   <LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
   representing <VAR title="">minute</VAR>, in the range
   0&nbsp;≤&nbsp;<VAR title="">minute</VAR>&nbsp;≤&nbsp;59</LI>

   <LI>Optionally (required if <VAR title="">second</VAR> is
   non-zero):

    <OL><LI>A U+003A COLON character (:)</LI>

     <LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
     representing the integer part of <VAR title="">second</VAR>, in
     the range 0&nbsp;≤&nbsp;<VAR title="">s</VAR>&nbsp;≤&nbsp;59</LI>

     <LI>Optionally (required if <VAR title="">second</VAR> is not an
     integer):

      <OL><LI>A 002E FULL STOP character (.)</LI>

       <LI>One or more <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>, representing the
       fractional part of <VAR title="">second</VAR></LI>

      </OL></LI>

    </OL></LI>

  </OL><P class="note">The <VAR title="">second</VAR> component cannot be
  60 or 61; leap seconds cannot be represented.</P><DIV class="impl">

  <P>The rules to <DFN id="parse-a-time-string">parse a time string</DFN> are as follows. This
  will return either a time, or nothing. If at any point the algorithm
  says that it "fails", this means that it is aborted at that point
  and returns nothing.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-time-component">Parse a time component</A> to obtain <VAR title="">hour</VAR>, <VAR title="">minute</VAR>, and <VAR title="">second</VAR>. If this returns nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is <EM>not</EM> beyond the
   end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P>Let <VAR title="">time</VAR> be the time with hour <VAR title="">hour</VAR>, minute <VAR title="">minute</VAR>, and second
   <VAR title="">second</VAR>.</P></LI>

   <LI><P>Return <VAR title="">time</VAR>.</P></LI>

  </OL><P>The rules to <DFN id="parse-a-time-component">parse a time component</DFN>, given an <VAR title="">input</VAR> string and a <VAR title="">position</VAR>, are
  as follows. This will return either an hour, a minute, and a second,
  or nothing. If at any point the algorithm says that it "fails", this
  means that it is aborted at that point and returns nothing.</P>

  <OL><LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
   sequence is not exactly two characters long, then fail. Otherwise,
   interpret the resulting sequence as a base-ten integer. Let that
   number be the <VAR title="">hour</VAR>.</P></LI>

   <LI>If <VAR title="">hour</VAR> is not a number in the range
   0&nbsp;≤&nbsp;<VAR title="">hour</VAR>&nbsp;≤&nbsp;23, then
   fail.</LI>

   <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+003A COLON character, then
   fail. Otherwise, move <VAR title="">position</VAR> forwards one
   character.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
   sequence is not exactly two characters long, then fail. Otherwise,
   interpret the resulting sequence as a base-ten integer. Let that
   number be the <VAR title="">minute</VAR>.</P></LI>

   <LI>If <VAR title="">minute</VAR> is not a number in the range
   0&nbsp;≤&nbsp;<VAR title="">minute</VAR>&nbsp;≤&nbsp;59, then
   fail.</LI>

   <LI><P>Let <VAR title="">second</VAR> be a string with the value
   "0".</P></LI>

   <LI>

    <P>If <VAR title="">position</VAR> is not beyond the end of
    <VAR title="">input</VAR> and the character at <VAR title="">position</VAR> is a U+003A COLON, then run these
    substeps:</P>

    <OL><LI><P>Advance <VAR title="">position</VAR> to the next character
     in <VAR title="">input</VAR>.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR>, or at the last character in <VAR title="">input</VAR>, or if the next <EM>two</EM> characters in
     <VAR title="">input</VAR> starting at <VAR title="">position</VAR> are not two characters both in the range
     U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
     fail.</P></LI>

     <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> that are
     either characters in the range U+0030 DIGIT ZERO (0) to U+0039
     DIGIT NINE (9) or U+002E FULL STOP characters. If the collected
     sequence has more than one U+002E FULL STOP characters, or if the
     last character in the sequence is a U+002E FULL STOP character,
     then fail. Otherwise, let the collected string be <VAR title="">second</VAR> instead of its previous value.</P></LI>

    </OL></LI>

   <LI><P>Interpret <VAR title="">second</VAR> as a base-ten number
   (possibly with a fractional part). Let <VAR title="">second</VAR>
   be that number instead of the string version.</P></LI>

   <LI><P>If <VAR title="">second</VAR> is not a number in the range
   0&nbsp;≤&nbsp;<VAR title="">second</VAR>&nbsp;&lt;&nbsp;60, then
   fail.</P></LI>

   <LI><P>Return <VAR title="">hour</VAR>, <VAR title="">minute</VAR>,
   and <VAR title="">second</VAR>.</P></LI>

  </OL></DIV><H5 id="local-dates-and-times"><SPAN class="secno">2.4.5.4 </SPAN>Local dates and times</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="concept-datetime-local" title="concept-datetime-local">local date and time</DFN>
  consists of a specific proleptic Gregorian date, consisting of a
  year, a month, and a day, and a time, consisting of an hour, a
  minute, a second, and a fraction of a second, but expressed without
  a time zone. <A href="http://dev.w3.org/html5/spec/Overview.html#refsGREGORIAN">[GREGORIAN]</A></P><P>A string is a <DFN id="valid-local-date-and-time-string">valid local date and time string</DFN>
  representing a date and time if it consists of the following
  components in the given order:</P><OL><LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-date-string">valid date string</A> representing the date.</LI>

   <LI>A U+0054 LATIN CAPITAL LETTER T character (T).</LI>

   <LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-time-string">valid time string</A> representing the time.</LI>

  </OL><DIV class="impl">

  <P>The rules to <DFN id="parse-a-local-date-and-time-string">parse a local date and time string</DFN> are as
  follows. This will return either a date and time, or nothing. If at
  any point the algorithm says that it "fails", this means that it is
  aborted at that point and returns nothing.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-date-component">Parse a date component</A> to obtain <VAR title="">year</VAR>, <VAR title="">month</VAR>, and <VAR title="">day</VAR>. If this returns nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+0054 LATIN CAPITAL LETTER T
   character (T) then fail. Otherwise, move <VAR title="">position</VAR> forwards one character.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-time-component">Parse a time component</A> to obtain <VAR title="">hour</VAR>, <VAR title="">minute</VAR>, and <VAR title="">second</VAR>. If this returns nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is <EM>not</EM> beyond the
   end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P>Let <VAR title="">date</VAR> be the date with year <VAR title="">year</VAR>, month <VAR title="">month</VAR>, and day <VAR title="">day</VAR>.</P></LI>

   <LI><P>Let <VAR title="">time</VAR> be the time with hour <VAR title="">hour</VAR>, minute <VAR title="">minute</VAR>, and second
   <VAR title="">second</VAR>.</P></LI>

   <LI><P>Return <VAR title="">date</VAR> and <VAR title="">time</VAR>.</P></LI>

  </OL></DIV><H5 id="global-dates-and-times"><SPAN class="secno">2.4.5.5 </SPAN>Global dates and times</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="concept-datetime" title="concept-datetime">global date and time</DFN>
  consists of a specific proleptic Gregorian date, consisting of a
  year, a month, and a day, and a time, consisting of an hour, a
  minute, a second, and a fraction of a second, expressed with a
  time-zone offset, consisting of a signed number of hours and
  minutes. <A href="http://dev.w3.org/html5/spec/Overview.html#refsGREGORIAN">[GREGORIAN]</A></P><P>A string is a <DFN id="valid-global-date-and-time-string">valid global date and time string</DFN>
  representing a date, time, and a time-zone offset if it consists of
  the following components in the given order:</P><OL><LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-date-string">valid date string</A> representing the date</LI>

   <LI>A U+0054 LATIN CAPITAL LETTER T character (T)</LI>

   <LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-time-string">valid time string</A> representing the time</LI>

   <LI>Either:

    <UL><LI>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
     if the time zone is UTC</LI>

     <LI>Or:

      <OL><LI>Either a U+002B PLUS SIGN character (+) or a U+002D
       HYPHEN-MINUS character (-), representing the sign of the
       time-zone offset</LI>

       <LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
       representing the hours component <VAR title="">hour</VAR> of
       the time-zone offset, in the range 0&nbsp;≤&nbsp;<VAR title="">hour</VAR>&nbsp;≤&nbsp;23</LI>

       <LI>A U+003A COLON character (:)</LI>

       <LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
       representing the minutes component <VAR title="">minute</VAR>
       of the time-zone offset, in the range 0&nbsp;≤&nbsp;<VAR title="">minute</VAR>&nbsp;≤&nbsp;59</LI>

      </OL></LI>

    </UL></LI>

  </OL><P class="note">This format allows for time-zone offsets from -23:59
  to +23:59. In practice, however, the range of offsets of actual time
  zones is -12:00 to +14:00, and the minutes component of offsets of
  actual time zones is always either 00, 30, or 45.</P><DIV class="example">

   <P>The following are some examples of dates written as <A href="http://dev.w3.org/html5/spec/Overview.html#valid-global-date-and-time-string" title="valid global date and time string">valid global date and
   time strings</A>.</P>

   <DL><DT>"<CODE>0037-12-13T00:00Z</CODE>"</DT>

    <DD>Midnight UTC on the birthday of Nero (the Roman Emperor).</DD>

    <DT>"<CODE>1979-10-14T12:00:00.001-04:00</CODE>"</DT>

    <DD>One millisecond after noon on October 14th 1979, in the time
    zone in use on the east coast of the USA during daylight saving
    time.</DD>

    <DT>"<CODE>8592-01-01T02:09+02:09</CODE>"</DT>

    <DD>Midnight UTC on the 1st of January, 8592. The time zone
    associated with that time is two hours and nine minutes ahead of
    UTC, which is not currently a real time zone, but is nonetheless
    allowed.</DD>

   </DL><P>Several things are notable about these dates:</P>

   <UL><LI>Years with fewer than four digits have to be
    zero-padded. The date "37-12-13" would not be a valid date.</LI>

    <LI>To unambiguously identify a moment in time prior to the
    introduction of the Gregorian calendar, the date has to be first
    converted to the Gregorian calendar from the calendar in use at
    the time (e.g. from the Julian calendar). The date of Nero's birth
    is the 15th of December 37, in the Julian Calendar, which is the
    13th of December 37 in the proleptic Gregorian Calendar.</LI> <!--
    This might not be true. I can't find a reference that gives his
    birthday with an explicit statement about the calendar being
    used. However, it seems unlikely that it would be given in the
    Gregorian calendar, so I assume sites use the Julian one. -->

    <LI>The time and time-zone offset components are not optional.</LI>

    <LI>Dates before the year one can't be represented as a datetime
    in this version of HTML.</LI>

    <LI>Time-zone offsets differ based on daylight savings time.</LI>

   </UL></DIV><DIV class="impl">

  <P>The <DFN id="best-representation-of-the-global-date-and-time-string">best representation of the global date and time
  string</DFN> <VAR title="">datetime</VAR> is the <A href="http://dev.w3.org/html5/spec/Overview.html#valid-global-date-and-time-string">valid global
  date and time string</A> representing <VAR title="">datetime</VAR> with the last character of the string not
  being a U+005A LATIN CAPITAL LETTER Z character (Z), even if the
  time zone is UTC, and with a U+002D HYPHEN-MINUS character (-)
  representing the sign of the time-zone offset when the time zone is
  UTC.</P>

  <P>The rules to <DFN id="parse-a-global-date-and-time-string">parse a global date and time string</DFN> are
  as follows. This will return either a time in UTC, with associated
  time-zone offset information for round tripping or display purposes,
  or nothing. If at any point the algorithm says that it "fails", this
  means that it is aborted at that point and returns nothing.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-date-component">Parse a date component</A> to obtain <VAR title="">year</VAR>, <VAR title="">month</VAR>, and <VAR title="">day</VAR>. If this returns nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+0054 LATIN CAPITAL LETTER T
   character (T) then fail. Otherwise, move <VAR title="">position</VAR> forwards one character.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-time-component">Parse a time component</A> to obtain <VAR title="">hour</VAR>, <VAR title="">minute</VAR>, and <VAR title="">second</VAR>. If this returns nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-time-zone-offset-component">Parse a time-zone offset component</A> to obtain
   <VAR title="">timezone<SUB title="">hours</SUB></VAR> and <VAR title="">timezone<SUB title="">minutes</SUB></VAR>. If this returns
   nothing, then fail.</P>

   </LI><LI><P>If <VAR title="">position</VAR> is <EM>not</EM> beyond the
   end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P>Let <VAR title="">time</VAR> be the moment in time at year
   <VAR title="">year</VAR>, month <VAR title="">month</VAR>, day <VAR title="">day</VAR>, hours <VAR title="">hour</VAR>, minute <VAR title="">minute</VAR>, second <VAR title="">second</VAR>,
   subtracting <VAR title="">timezone<SUB title="">hours</SUB></VAR>
   hours and <VAR title="">timezone<SUB title="">minutes</SUB></VAR>
   minutes. That moment in time is a moment in the UTC
   time zone.</P></LI>

   <LI><P>Let <VAR title="">timezone</VAR> be <VAR title="">timezone<SUB title="">hours</SUB></VAR> hours and <VAR title="">timezone<SUB title="">minutes</SUB></VAR> minutes from
   UTC.</P></LI>

   <LI><P>Return <VAR title="">time</VAR> and <VAR title="">timezone</VAR>.</P></LI>

  </OL><P>The rules to <DFN id="parse-a-time-zone-offset-component">parse a time-zone offset component</DFN>, given
  an <VAR title="">input</VAR> string and a <VAR title="">position</VAR>, are as follows. This will return either
  time-zone hours and time-zone minutes, or nothing. If at any point
  the algorithm says that it "fails", this means that it is aborted at
  that point and returns nothing.</P>

  <OL><LI>

    <P>If the character at <VAR title="">position</VAR> is a U+005A
    LATIN CAPITAL LETTER Z character (Z), then:</P>

    <OL><LI><P>Let <VAR title="">timezone<SUB title="">hours</SUB></VAR>
     be 0.</P></LI>

     <LI><P>Let <VAR title="">timezone<SUB title="">minutes</SUB></VAR> be 0.</P></LI>

     <LI><P>Advance <VAR title="">position</VAR> to the next character
     in <VAR title="">input</VAR>.</P></LI>

    </OL><P>Otherwise, if the character at <VAR title="">position</VAR> is
    either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-),
    then:</P>

    <OL><LI><P>If the character at <VAR title="">position</VAR> is a
     U+002B PLUS SIGN (+), let <VAR title="">sign</VAR> be
     "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let <VAR title="">sign</VAR> be "negative".</P></LI>

     <LI><P>Advance <VAR title="">position</VAR> to the next character
     in <VAR title="">input</VAR>.</P></LI>

     <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
     U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
     sequence is not exactly two characters long, then
     fail. Otherwise, interpret the resulting sequence as a base-ten
     integer. Let that number be the <VAR title="">timezone<SUB title="">hours</SUB></VAR>.</P></LI>

     <LI>If <VAR title="">timezone<SUB title="">hours</SUB></VAR> is
     not a number in the range 0&nbsp;≤&nbsp;<VAR title="">timezone<SUB title="">hours</SUB></VAR>&nbsp;≤&nbsp;23, then fail.</LI>

     <LI>If <VAR title="">sign</VAR> is "negative", then negate <VAR title="">timezone<SUB title="">hours</SUB></VAR>.</LI>

     <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+003A COLON character, then
     fail. Otherwise, move <VAR title="">position</VAR> forwards one
     character.</P></LI>

     <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
     U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
     sequence is not exactly two characters long, then
     fail. Otherwise, interpret the resulting sequence as a base-ten
     integer. Let that number be the <VAR title="">timezone<SUB title="">minutes</SUB></VAR>.</P></LI>

     <LI>If <VAR title="">timezone<SUB title="">minutes</SUB></VAR> is
     not a number in the range 0&nbsp;≤&nbsp;<VAR title="">timezone<SUB title="">minutes</SUB></VAR>&nbsp;≤&nbsp;59, then fail.</LI>

     <LI>If <VAR title="">sign</VAR> is "negative", then negate <VAR title="">timezone<SUB title="">minutes</SUB></VAR>.</LI>

    </OL><P>Otherwise, fail.</P>

   </LI>

   <LI><P>Return <VAR title="">timezone<SUB title="">hours</SUB></VAR>
   and <VAR title="">timezone<SUB title="">minutes</SUB></VAR>.</P></LI>

  </OL></DIV><H5 id="weeks"><SPAN class="secno">2.4.5.6 </SPAN>Weeks</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="concept-week" title="concept-week">week</DFN> consists of a week-year
  number and a week number representing a seven-day period starting on
  a Monday. Each week-year in this calendaring system has either 52 or
  53 such seven-day periods, as defined below. The seven-day period
  starting on the Gregorian date Monday December 29th 1969
  (1969-12-29) is defined as week number 1 in week-year
  1970. Consecutive weeks are numbered sequentially. The week before
  the number 1 week in a week-year is the last week in the previous
  week-year, and vice versa. <A href="http://dev.w3.org/html5/spec/Overview.html#refsGREGORIAN">[GREGORIAN]</A></P><P>A week-year with a number <VAR title="">year</VAR> has 53 weeks
  if it corresponds to either a year <VAR title="">year</VAR> in the
  proleptic Gregorian calendar that has a Thursday as its first day
  (January 1st), or a year <VAR title="">year</VAR> in the proleptic
  Gregorian calendar that has a Wednesday as its first day (January
  1st) and where <VAR title="">year</VAR> is a number divisible by
  400, or a number divisible by 4 but not by 100. All other week-years
  have 52 weeks.</P><P>The <DFN id="week-number-of-the-last-day">week number of the last day</DFN> of a week-year with 53
  weeks is 53; the week number of the last day of a week-year with 52
  weeks is 52.</P><P class="note">The week-year number of a particular day can be
  different than the number of the year that contains that day in the
  proleptic Gregorian calendar. The first week in a week-year <VAR title="">y</VAR> is the week that contains the first Thursday of
  the Gregorian year <VAR title="">y</VAR>.</P><P>A string is a <DFN id="valid-week-string">valid week string</DFN> representing a
  week-year <VAR title="">year</VAR> and week <VAR title="">week</VAR>
  if it consists of the following components in the given order:</P><OL><LI>Four or more <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>, representing <VAR title="">year</VAR>, where <VAR title="">year</VAR>&nbsp;&gt;&nbsp;0</LI>

   <LI>A U+002D HYPHEN-MINUS character (-)</LI>

   <LI>A U+0057 LATIN CAPITAL LETTER W character (W)</LI>

   <LI>Two <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime-digit" title="concept-datetime-digit">digits</A>,
   representing the week <VAR title="">week</VAR>, in the range
   1&nbsp;≤&nbsp;<VAR title="">week</VAR>&nbsp;≤&nbsp;<VAR title="">maxweek</VAR>, where <VAR title="">maxweek</VAR> is the
   <A href="http://dev.w3.org/html5/spec/Overview.html#week-number-of-the-last-day">week number of the last day</A> of week-year <VAR title="">year</VAR></LI>

  </OL><DIV class="impl">

  <P>The rules to <DFN id="parse-a-week-string">parse a week string</DFN> are as follows. This
  will return either a week-year number and week number, or
  nothing. If at any point the algorithm says that it "fails", this
  means that it is aborted at that point and returns nothing.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
   sequence is not at least four characters long, then
   fail. Otherwise, interpret the resulting sequence as a base-ten
   integer. Let that number be the <VAR title="">year</VAR>.</P></LI>

   <LI><P>If <VAR title="">year</VAR> is not a number greater than
   zero, then fail.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+002D HYPHEN-MINUS character,
   then fail. Otherwise, move <VAR title="">position</VAR> forwards
   one character.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or if the character at <VAR title="">position</VAR> is not a U+0057 LATIN CAPITAL LETTER W
   character (W), then fail. Otherwise, move <VAR title="">position</VAR> forwards one character.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> in the range
   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
   sequence is not exactly two characters long, then fail. Otherwise,
   interpret the resulting sequence as a base-ten integer. Let that
   number be the <VAR title="">week</VAR>.</P></LI>

   <LI><P>Let <VAR title="">maxweek</VAR> be the <A href="http://dev.w3.org/html5/spec/Overview.html#week-number-of-the-last-day">week number of
   the last day</A> of year <VAR title="">year</VAR>.</P></LI>

   <LI><P>If <VAR title="">week</VAR> is not a number in the range
   1&nbsp;≤&nbsp;<VAR title="">week</VAR>&nbsp;≤&nbsp;<VAR title="">maxweek</VAR>, then fail.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is <EM>not</EM> beyond the
   end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P>Return the week-year number <VAR title="">year</VAR> and the
   week number <VAR title="">week</VAR>.</P></LI>

  </OL></DIV><H5 id="vaguer-moments-in-time"><SPAN class="secno">2.4.5.7 </SPAN>Vaguer moments in time</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A string is a <DFN id="valid-date-or-time-string">valid date or time string</DFN> if it is also
  one of the following:</P><UL><LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-date-string">valid date string</A>.</LI>

   <LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-time-string">valid time string</A>.</LI>

   <LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-global-date-and-time-string">valid global date and time string</A>.</LI>

  </UL><P>A string is a <DFN id="valid-date-or-time-string-in-content">valid date or time string in content</DFN> if
  it consists of zero or more <A href="http://dev.w3.org/html5/spec/Overview.html#white_space">White_Space</A> characters,
  followed by a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-date-or-time-string">valid date or time string</A>, followed by
  zero or more further <A href="http://dev.w3.org/html5/spec/Overview.html#white_space">White_Space</A> characters.</P><HR><P>A string is a <DFN id="valid-date-string-with-optional-time">valid date string with optional time</DFN> if
  it is also one of the following:</P><UL><LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-date-string">valid date string</A>.</LI>

   <LI>A <A href="http://dev.w3.org/html5/spec/Overview.html#valid-global-date-and-time-string">valid global date and time string</A>.</LI>

  </UL><P>A string is a <DFN id="valid-date-string-in-content-with-optional-time">valid date string in content with optional
  time</DFN> if it consists of zero or more <A href="http://dev.w3.org/html5/spec/Overview.html#white_space">White_Space</A>
  characters, followed by a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-date-string-with-optional-time">valid date string with optional
  time</A>, followed by zero or more further
  <A href="http://dev.w3.org/html5/spec/Overview.html#white_space">White_Space</A> characters.</P><DIV class="impl">

  <HR><P>The rules to <DFN id="parse-a-date-or-time-string">parse a date or time string</DFN> are as
  follows. The algorithm is invoked with a flag indicating if the
  <I>in attribute</I> variant or the <I>in content</I> variant is to
  be used. The algorithm will return either a <A href="http://dev.w3.org/html5/spec/Overview.html#concept-date" title="concept-date">date</A>, a <A href="http://dev.w3.org/html5/spec/Overview.html#concept-time" title="concept-time">time</A>, a <A href="http://dev.w3.org/html5/spec/Overview.html#concept-datetime" title="concept-datetime">global date and time</A>, or nothing. If
  at any point the algorithm says that it "fails", this means that it
  is aborted at that point and returns nothing.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P>For the <I>in content</I> variant: <A href="http://dev.w3.org/html5/spec/Overview.html#skip-white_space-characters">skip White_Space
   characters</A>.</P></LI>

   <LI><P>Set <VAR title="">start position</VAR> to the same position
   as <VAR title="">position</VAR>.</P></LI>

   <LI><P>Set the <VAR title="">date present</VAR> and <VAR title="">time present</VAR> flags to true.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-date-component">Parse a date component</A> to obtain <VAR title="">year</VAR>, <VAR title="">month</VAR>, and <VAR title="">day</VAR>. If this fails, then set the <VAR title="">date
   present</VAR> flag to false.</P>

   </LI><LI>

    <P>If <VAR title="">date present</VAR> is true, and <VAR title="">position</VAR> is not beyond the end of <VAR title="">input</VAR>, and the character at <VAR title="">position</VAR> is a U+0054 LATIN CAPITAL LETTER T
    character (T), then advance <VAR title="">position</VAR> to the
    next character in <VAR title="">input</VAR>.</P>

    <P>Otherwise, if <VAR title="">date present</VAR> is true, and
    either <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR> or the character at <VAR title="">position</VAR> is not a U+0054 LATIN CAPITAL LETTER T
    character (T), then set <VAR title="">time present</VAR> to
    false.</P>

    <P>Otherwise, if <VAR title="">date present</VAR> is false, set
    <VAR title="">position</VAR> back to the same position as <VAR title="">start position</VAR>.</P>

   </LI>

   <LI><P>If the <VAR title="">time present</VAR> flag is true, then
   <A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-time-component">parse a time component</A> to obtain <VAR title="">hour</VAR>, <VAR title="">minute</VAR>, and <VAR title="">second</VAR>. If this returns nothing, then set the <VAR title="">time present</VAR> flag to false.</P>

   </LI><LI><P>If both the <VAR title="">date present</VAR> and <VAR title="">time present</VAR> flags are false, then fail.</P></LI>

   <LI><P>If the <VAR title="">date present</VAR> and <VAR title="">time present</VAR> flags are both true, but <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI><P>If the <VAR title="">date present</VAR> and <VAR title="">time present</VAR> flags are both true, <A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-time-zone-offset-component">parse a
   time-zone offset component</A> to obtain <VAR title="">timezone<SUB title="">hours</SUB></VAR> and <VAR title="">timezone<SUB title="">minutes</SUB></VAR>. If this returns
   nothing, then fail.</P>

   </LI><LI><P>For the <I>in content</I> variant: <A href="http://dev.w3.org/html5/spec/Overview.html#skip-white_space-characters">skip White_Space
   characters</A>.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is <EM>not</EM> beyond the
   end of <VAR title="">input</VAR>, then fail.</P></LI>

   <LI>

    <P>If the <VAR title="">date present</VAR> flag is true and the
    <VAR title="">time present</VAR> flag is false, then let <VAR title="">date</VAR> be the date with year <VAR title="">year</VAR>, month <VAR title="">month</VAR>, and day <VAR title="">day</VAR>, and return <VAR title="">date</VAR>.</P>

    <P>Otherwise, if the <VAR title="">time present</VAR> flag is true
    and the <VAR title="">date present</VAR> flag is false, then let
    <VAR title="">time</VAR> be the time with hour <VAR title="">hour</VAR>, minute <VAR title="">minute</VAR>, and second
    <VAR title="">second</VAR>, and return <VAR title="">time</VAR>.</P>

    <P>Otherwise, let <VAR title="">time</VAR> be the moment in time
    at year <VAR title="">year</VAR>, month <VAR title="">month</VAR>,
    day <VAR title="">day</VAR>, hours <VAR title="">hour</VAR>,
    minute <VAR title="">minute</VAR>, second <VAR title="">second</VAR>, subtracting <VAR title="">timezone<SUB title="">hours</SUB></VAR> hours and <VAR title="">timezone<SUB title="">minutes</SUB></VAR> minutes, that moment in time being a
    moment in the UTC time zone; let <VAR title="">timezone</VAR> be
    <VAR title="">timezone<SUB title="">hours</SUB></VAR> hours and
    <VAR title="">timezone<SUB title="">minutes</SUB></VAR> minutes
    from UTC; and return <VAR title="">time</VAR> and <VAR title="">timezone</VAR>.</P>

   </LI>

  </OL></DIV><H4 id="colors"><SPAN class="secno">2.4.6 </SPAN>Colors</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="simple-color">simple color</DFN> consists of three 8-bit numbers in the
  range 0..255, representing the red, green, and blue components of
  the color respectively, in the sRGB color space. <A href="http://dev.w3.org/html5/spec/Overview.html#refsSRGB">[SRGB]</A></P><P>A string is a <DFN id="valid-simple-color">valid simple color</DFN> if it is exactly
  seven characters long, and the first character is a U+0023 NUMBER
  SIGN character (#), and the remaining six characters are all in the
  range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), U+0041 LATIN
  CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F, U+0061 LATIN
  SMALL LETTER A to U+0066 LATIN SMALL LETTER F, with the first two
  digits representing the red component, the middle two digits
  representing the green component, and the last two digits
  representing the blue component, in hexadecimal.</P><P>A string is a <DFN id="valid-lowercase-simple-color">valid lowercase simple color</DFN> if it is a
  <A href="http://dev.w3.org/html5/spec/Overview.html#valid-simple-color">valid simple color</A> and doesn't use any characters in
  the range U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL
  LETTER F.</P><DIV class="impl">

  <P>The <DFN id="rules-for-parsing-simple-color-values">rules for parsing simple color values</DFN> are as given
  in the following algorithm. When invoked, the steps must be followed
  in the order given, aborting at the first step that returns a
  value. This algorithm will return either a <A href="http://dev.w3.org/html5/spec/Overview.html#simple-color">simple color</A>
  or an error.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>If <VAR title="">input</VAR> is not exactly seven characters
   long, then return an error.</P></LI>

   <LI><P>If the first character in <VAR title="">input</VAR> is not a
   U+0023 NUMBER SIGN character (#), then return an error.</P></LI>

   <LI><P>If the last six characters of <VAR title="">input</VAR> are
   not all in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
   (9), U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER
   F, U+0061 LATIN SMALL LETTER A to U+0066 LATIN SMALL LETTER F, then
   return an error.</P></LI>

   <LI><P>Let <VAR title="">result</VAR> be a <A href="http://dev.w3.org/html5/spec/Overview.html#simple-color">simple
   color</A>.</P>

   </LI><LI><P>Interpret the second and third characters as a hexadecimal
   number and let the result be the red component of <VAR title="">result</VAR>.</P>

   </LI><LI><P>Interpret the fourth and fifth characters as a hexadecimal
   number and let the result be the green component of <VAR title="">result</VAR>.</P>

   </LI><LI><P>Interpret the sixth and seventh characters as a hexadecimal
   number and let the result be the blue component of <VAR title="">result</VAR>.</P>

   </LI><LI><P>Return <VAR title="">result</VAR>.</P>

  </LI></OL><P>The <DFN id="rules-for-serializing-simple-color-values">rules for serializing simple color values</DFN> given a
  <A href="http://dev.w3.org/html5/spec/Overview.html#simple-color">simple color</A> are as given in the following
  algorithm:</P>

  <OL><LI><P>Let <VAR title="">result</VAR> be a string consisting of a
   single U+0023 NUMBER SIGN character (#).</P></LI>

   <LI><P>Convert the red, green, and blue components in turn to
   two-digit hexadecimal numbers using the digits U+0030 DIGIT ZERO
   (0) to U+0039 DIGIT NINE (9) and U+0061 LATIN SMALL LETTER A
   to U+0066 LATIN SMALL LETTER F, zero-padding if necessary, and
   append these numbers to <VAR title="">result</VAR>, in the order
   red, green, blue.</P>

   </LI><LI><P>Return <VAR title="">result</VAR>, which will be a
   <A href="http://dev.w3.org/html5/spec/Overview.html#valid-lowercase-simple-color">valid lowercase simple color</A>.</P></LI>

  </OL><HR><P>Some obsolete legacy attributes parse colors in a more
  complicated manner, using the <DFN id="rules-for-parsing-a-legacy-color-value">rules for parsing a legacy color
  value</DFN>, which are given in the following algorithm. When
  invoked, the steps must be followed in the order given, aborting at
  the first step that returns a value. This algorithm will return
  either a <A href="http://dev.w3.org/html5/spec/Overview.html#simple-color">simple color</A> or an error.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>If <VAR title="">input</VAR> is the empty string, then
   return an error.</P></LI>

   <LI><P>If <VAR title="">input</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
   case-insensitive</A> match for the string "<CODE title="">transparent</CODE>", then return an error.</P></LI>

   <LI><P>If <VAR title="">input</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
   case-insensitive</A> match for one of the keywords listed in the
   <A href="http://www.w3.org/TR/css3-color/#svg-color">SVG color
   keywords</A> or <A href="http://www.w3.org/TR/css3-color/#css2-system">CSS2 System
   Colors</A> sections of the CSS3 Color specification, then return
   the <A href="http://dev.w3.org/html5/spec/Overview.html#simple-color">simple color</A> corresponding to that keyword. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCSSCOLOR">[CSSCOLOR]</A></P></LI>

   <LI>

    <P>If <VAR title="">input</VAR> is four characters long, and the
    first character in <VAR title="">input</VAR> is a U+0023 NUMBER
    SIGN character (#), and the last three characters of <VAR title="">input</VAR> are all in the range U+0030 DIGIT ZERO (0)
    to U+0039 DIGIT NINE (9), U+0041 LATIN CAPITAL LETTER A to U+0046
    LATIN CAPITAL LETTER F, and U+0061 LATIN SMALL LETTER A to U+0066
    LATIN SMALL LETTER F, then run these substeps:</P>

    <OL><LI><P>Let <VAR title="">result</VAR> be a <A href="http://dev.w3.org/html5/spec/Overview.html#simple-color">simple
     color</A>.</P>

     </LI><LI><P>Interpret the second character of <VAR title="">input</VAR> as a hexadecimal digit; let the red
     component of <VAR title="">result</VAR> be the resulting number
     multiplied by 17.</P>

     </LI><LI><P>Interpret the third character of <VAR title="">input</VAR>
     as a hexadecimal digit; let the green component of <VAR title="">result</VAR> be the resulting number multiplied by
     17.</P>

     </LI><LI><P>Interpret the fourth character of <VAR title="">input</VAR> as a hexadecimal digit; let the blue
     component of <VAR title="">result</VAR> be the resulting number
     multiplied by 17.</P>

     </LI><LI><P>Return <VAR title="">result</VAR>.</P>

    </LI></OL></LI>

   <LI><P>Replace any characters in <VAR title="">input</VAR> that
   have a Unicode code point greater than U+FFFF (i.e. any characters
   that are not in the basic multilingual plane) with the
   two-character string "<CODE title="">00</CODE>".</P></LI>

   <LI><P>If <VAR title="">input</VAR> is longer than 128 characters,
   truncate <VAR title="">input</VAR>, leaving only the first 128
   characters.</P></LI>

   <LI><P>If the first character in <VAR title="">input</VAR> is a
   U+0023 NUMBER SIGN character (#), remove it.</P></LI>

   <LI><P>Replace any character in <VAR title="">input</VAR> that is
   not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
   U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F, and
   U+0061 LATIN SMALL LETTER A to U+0066 LATIN SMALL LETTER F with the
   character U+0030 DIGIT ZERO (0).</P></LI>

   <LI><P>While <VAR title="">input</VAR>'s length is zero or not a
   multiple of three, append a U+0030 DIGIT ZERO (0) character to <VAR title="">input</VAR>.</P></LI>

   <LI><P>Split <VAR title="">input</VAR> into three strings of equal
   length, to obtain three components. Let <VAR title="">length</VAR>
   be the length of those components (one third the length of <VAR title="">input</VAR>).</P></LI>

   <LI><P>If <VAR title="">length</VAR> is greater than 8, then remove
   the leading <SPAN title=""><VAR title="">length</VAR>-8</SPAN>
   characters in each component, and let <VAR title="">length</VAR> be
   8.</P></LI>

   <LI><P>While <VAR title="">length</VAR> is greater than two and the
   first character in each component is a U+0030 DIGIT ZERO (0)
   character, remove that character and reduce <VAR title="">length</VAR> by one.</P></LI>

   <LI><P>If <VAR title="">length</VAR> is <EM>still</EM> greater than
   two, truncate each component, leaving only the first two
   characters in each.</P></LI>

   <LI><P>Let <VAR title="">result</VAR> be a <A href="http://dev.w3.org/html5/spec/Overview.html#simple-color">simple
   color</A>.</P>

   </LI><LI><P>Interpret the first component as a hexadecimal number; let
   the red component of <VAR title="">result</VAR> be the resulting
   number.</P></LI>

   <LI><P>Interpret the second component as a hexadecimal number; let
   the green component of <VAR title="">result</VAR> be the resulting
   number.</P></LI>

   <LI><P>Interpret the third component as a hexadecimal number; let
   the blue component of <VAR title="">result</VAR> be the resulting
   number.</P></LI>

   <LI><P>Return <VAR title="">result</VAR>.</P>

  </LI></OL></DIV><HR><H4 id="space-separated-tokens"><SPAN class="secno">2.4.7 </SPAN>Space-separated tokens</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="set-of-space-separated-tokens">set of space-separated tokens</DFN> is a string containing
  zero or more words separated by one or more <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space
  character">space characters</A>, where words consist of any
  string of one or more characters, none of which are <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>.</P><P>A string containing a <A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens">set of space-separated tokens</A>
  may have leading or trailing <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space
  characters</A>.</P><P>An <DFN id="unordered-set-of-unique-space-separated-tokens">unordered set of unique space-separated tokens</DFN> is a
  <A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens">set of space-separated tokens</A> where none of the words
  are duplicated.</P><P>An <DFN id="ordered-set-of-unique-space-separated-tokens">ordered set of unique space-separated tokens</DFN> is a
  <A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens">set of space-separated tokens</A> where none of the words
  are duplicated but where the order of the tokens is meaningful.</P><P><A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens" title="set of space-separated tokens">Sets of
  space-separated tokens</A> sometimes have a defined set of
  allowed values. When a set of allowed values is defined, the tokens
  must all be from that list of allowed values; other values are
  non-conforming. If no such set of allowed values is provided, then
  all values are conforming.</P><DIV class="impl">

  <P>When a user agent has to <DFN id="split-a-string-on-spaces">split a string on spaces</DFN>, it
  must use the following algorithm:</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P>Let <VAR title="">tokens</VAR> be a list of tokens,
   initially empty.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A></P></LI>

   <LI><P>While <VAR title="">position</VAR> is not past the end of
   <VAR title="">input</VAR>:</P>

    <OL><LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> that are not
     <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>.</P></LI>

     <LI><P>Add the string collected in the previous step to <VAR title="">tokens</VAR>.</P></LI>

     <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A></P></LI>

    </OL></LI>

   <LI><P>Return <VAR title="">tokens</VAR>.</P></LI>

  </OL><P>When a user agent has to <DFN id="remove-a-token-from-a-string">remove a token from a string</DFN>,
  it must use the following algorithm:</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   modified.</P></LI>

   <LI><P>Let <VAR title="">token</VAR> be the token being removed. It
   will not contain any <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space
   characters</A>.</P></LI>

   <LI><P>Let <VAR title="">output</VAR> be the output string,
   initially empty.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is beyond the end of <VAR title="">input</VAR>, abort these steps.</P></LI>

   <LI><P>If the character at <VAR title="">position</VAR> is a
   <A href="http://dev.w3.org/html5/spec/Overview.html#space-character">space character</A>:</P>

    <OL><LI><P>Append the character at <VAR title="">position</VAR> to
     the end of <VAR title="">output</VAR>.</P></LI>

     <LI><P>Advance <VAR title="">position</VAR> so it points at the
     next character in <VAR title="">input</VAR>.</P></LI>

     <LI><P>Return to step 5 in the overall set of steps.</P></LI>

    </OL></LI>

   <LI><P>Otherwise, the character at <VAR title="">position</VAR> is
   the first character of a token. <A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of
   characters</A> that are not <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space
   characters</A>, and let that be <VAR title="">s</VAR>.</P></LI>

   <LI><P>If <VAR title="">s</VAR> is exactly equal to <VAR title="">token</VAR>, then:</P>

    <OL><LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#skip-whitespace">Skip whitespace</A> (in <VAR title="">input</VAR>).</P></LI>

     <LI><P>Remove any <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space
     characters</A> currently at the end of <VAR title="">output</VAR>.</P></LI>

     <LI><P>If <VAR title="">position</VAR> is not past the end of
     <VAR title="">input</VAR>, and <VAR title="">output</VAR> is not
     the empty string, append a single U+0020 SPACE character at the
     end of <VAR title="">output</VAR>.</P></LI>

    </OL></LI>

   <LI><P>Otherwise, append <VAR title="">s</VAR> to the end of <VAR title="">output</VAR>.</P></LI>

   <LI><P>Return to step 6 in the overall set of steps.</P></LI>

  </OL><P class="note">This causes any occurrences of the token to be
  removed from the string, and any spaces that were surrounding the
  token to be collapsed to a single space, except at the start and end
  of the string, where such spaces are removed.</P>

  </DIV><H4 id="comma-separated-tokens"><SPAN class="secno">2.4.8 </SPAN>Comma-separated tokens</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="set-of-comma-separated-tokens">set of comma-separated tokens</DFN> is a string containing
  zero or more tokens each separated from the next by a single U+002C
  COMMA character (,), where tokens consist of any string of zero or
  more characters, neither beginning nor ending with <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>, nor containing any
  U+002C COMMA characters (,), and optionally surrounded by <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>.</P><P class="example">For instance, the string "<CODE title="">&nbsp;a&nbsp;,b,,d&nbsp;d&nbsp;</CODE>" consists of four
  tokens: "a", "b", the empty string, and "d&nbsp;d". Leading and
  trailing whitespace around each token doesn't count as part of the
  token, and the empty string can be a token.</P><P><A href="http://dev.w3.org/html5/spec/Overview.html#set-of-comma-separated-tokens" title="set of comma-separated tokens">Sets of
  comma-separated tokens</A> sometimes have further restrictions on
  what consists a valid token. When such restrictions are defined, the
  tokens must all fit within those restrictions; other values are
  non-conforming. If no such restrictions are specified, then all
  values are conforming.</P><DIV class="impl">

  <P>When a user agent has to <DFN id="split-a-string-on-commas">split a string on commas</DFN>, it
  must use the following algorithm:</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the string being
   parsed.</P></LI>

   <LI><P>Let <VAR title="">position</VAR> be a pointer into <VAR title="">input</VAR>, initially pointing at the start of the
   string.</P></LI>

   <LI><P>Let <VAR title="">tokens</VAR> be a list of tokens,
   initially empty.</P></LI>

   <LI><P><I>Token</I>: If <VAR title="">position</VAR> is past the
   end of <VAR title="">input</VAR>, jump to the last step.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#collect-a-sequence-of-characters">Collect a sequence of characters</A> that are not
   U+002C COMMA characters (,). Let <VAR title="">s</VAR> be the resulting sequence (which might be the
   empty string).</P></LI>

   <LI><P>Remove any leading or trailing sequence of <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A> from <VAR title="">s</VAR>.</P></LI>

   <LI><P>Add <VAR title="">s</VAR> to <VAR title="">tokens</VAR>.</P></LI>

   <LI><P>If <VAR title="">position</VAR> is not past the end of <VAR title="">input</VAR>, then the character at <VAR title="">position</VAR> is a U+002C COMMA character (,); advance
   <VAR title="">position</VAR> past that character.</P></LI>

   <LI><P>Jump back to the step labeled <I>token</I>.</P></LI>

   <LI><P>Return <VAR title="">tokens</VAR>.</P></LI>

  </OL></DIV><H4 id="syntax-references"><SPAN class="secno">2.4.9 </SPAN>References</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="valid-hash-name-reference">valid hash-name reference</DFN> to an element of type <VAR title="">type</VAR> is a string consisting of a U+0023 NUMBER SIGN
  character (#) followed by a string which exactly matches the value
  of the <CODE title="">name</CODE> attribute of an element with type
  <VAR title="">type</VAR> in the document.</P><DIV class="impl">

  <P>The <DFN id="rules-for-parsing-a-hash-name-reference">rules for parsing a hash-name reference</DFN> to an
  element of type <VAR title="">type</VAR> are as follows:</P>

  <OL><LI><P>If the string being parsed does not contain a U+0023 NUMBER
   SIGN character, or if the first such character in the string is the
   last character in the string, then return null and abort these
   steps.</P></LI>

   <LI><P>Let <VAR title="">s</VAR> be the string from the character
   immediately after the first U+0023 NUMBER SIGN character in the
   string being parsed up to the end of that string.</P></LI>

   <LI><P>Return the first element of type <VAR title="">type</VAR>
   that has an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute whose value
   is a <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A> match for <VAR title="">s</VAR> or
   a <CODE title="">name</CODE> attribute whose value is a
   <A href="http://dev.w3.org/html5/spec/Overview.html#compatibility-caseless">compatibility caseless</A> match for <VAR title="">s</VAR>.</P></LI>

   <!--
   IE is also doing case-insensitive id="" matching.
   Tests:
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cmap%20name%3D%22T%26eacute%3B%26%23x01F1%3B%26%23x2075%3B%22%3E%3Carea%20href%3D%22%2F%22%20shape%3Drect%20coords%3D0%2C0%2C200%2C200%3E%3C%2Fmap%3E%0A%3Cimg%20usemap%3D%22%23t%26Eacute%3BDZ5%22%20src%3Dimage%3E
   ...except that doesn't explain why this fails:
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cmap%20name%3D%22T%26eacute%3B%26%23x01F1%3B%26%23x2075%3B%26%23xFB01%3B%22%3E%3Carea%20href%3D%22%2F%22%20shape%3Drect%20coords%3D0%2C0%2C200%2C200%3E%3C%2Fmap%3E%0A%3Cimg%20usemap%3D%22%23t%26Eacute%3BDZ5F%26%23x0131%3B%26%23x0307%3B%22%20src%3Dimage%3E
   maybe they just don't know about combining dot above?
   -->

  </OL></DIV><H4 id="mq"><SPAN class="secno">2.4.10 </SPAN>Media queries</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A string is a <DFN id="valid-media-query">valid media query</DFN> if it matches the
  <CODE title="">media_query_list</CODE> production of the Media
  Queries specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMQ">[MQ]</A></P><P>A string <DFN id="matches-the-environment">matches the environment</DFN> of a view if it is
  the empty string, a string consisting of only <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space
  character">space characters</A>, or is a media query that matches
  that view's environment according to the definitions given in the
  Media Queries specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMQ">[MQ]</A></P><H3 id="urls"><SPAN class="secno">2.5 </SPAN>URLs</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments. </I><SPAN><A href="http://www.w3.org/html/wg/tracker/issues/56">ISSUE-56</A> (urls-webarch) blocks progress to Last Call</SPAN></P><H4 id="terminology-0"><SPAN class="secno">2.5.1 </SPAN>Terminology</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="url">URL</DFN> is a string used to identify a resource.</P><P>A <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A> is a <DFN id="valid-url">valid URL</DFN> if it is a
  <SPAN>valid Web address</SPAN> as defined by the Web addresses
  specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsWEBADDRESSES">[WEBADDRESSES]</A></P><P>A <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A> is an <DFN id="absolute-url">absolute URL</DFN> if it is an
  <SPAN>absolute Web address</SPAN> as defined by the Web addresses
  specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsWEBADDRESSES">[WEBADDRESSES]</A></P><DIV class="impl">

  <P>To <DFN id="parse-a-url">parse a URL</DFN> <VAR title="">url</VAR> into its
  component parts, the user agent must use the <SPAN>parse a Web
  address</SPAN> algorithm defined by the Web addresses
  specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsWEBADDRESSES">[WEBADDRESSES]</A></P>

  <P>Parsing a URL results in the following components, again as
  defined by the Web addresses specification:</P>

  <UL class="brief"><LI><DFN id="url-scheme" title="url-scheme">&lt;scheme&gt;</DFN></LI>
   <LI><DFN id="url-host" title="url-host">&lt;host&gt;</DFN></LI>
   <LI><DFN id="url-port" title="url-port">&lt;port&gt;</DFN></LI>
   <LI><DFN id="url-hostport" title="url-hostport">&lt;hostport&gt;</DFN></LI>
   <LI><DFN id="url-path" title="url-path">&lt;path&gt;</DFN></LI>
   <LI><DFN id="url-query" title="url-query">&lt;query&gt;</DFN></LI>
   <LI><DFN id="url-fragment" title="url-fragment">&lt;fragment&gt;</DFN></LI>
   <LI><DFN id="url-host-specific" title="url-host-specific">&lt;host-specific&gt;</DFN></LI>
  </UL><P>To <DFN id="resolve-a-url">resolve a URL</DFN> to an <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A>
  relative to either another <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> or an element,
  the user agent must use the <SPAN>resolve a Web address</SPAN>
  algorithm defined by the Web addresses specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsWEBADDRESSES">[WEBADDRESSES]</A></P>

  <P>The <DFN id="document-base-url">document base URL</DFN> of a <CODE>Document</CODE>
  object is the <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> obtained by running these
  substeps:</P>

  <OL><LI><P>Let <VAR title="">fallback base url</VAR> be <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the
   document's address</A>.</P></LI>

   <LI>

    <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->

    <!-- this should be tested in the case of a browsing context that
    was navigated to about:blank after having been elsewhere, as
    opposed to the about:blank used at the time of the browsing
    context's creation. -->

    <P>If <VAR title="">fallback base url</VAR> is
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#about:blank">about:blank</A></CODE>, and the <CODE>Document</CODE>'s
    <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A> has a <A href="http://dev.w3.org/html5/spec/Overview.html#creator-browsing-context">creator browsing
    context</A>, then let <VAR title="">fallback base url</VAR>
    be the <A href="http://dev.w3.org/html5/spec/Overview.html#document-base-url">document base URL</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#creator-document">creator
    <CODE>Document</CODE></A> instead.</P>

   </LI>

   <LI><P>If there is no <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> element that is both a
   child of <A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element">the <CODE>head</CODE> element</A> and has an
   <CODE title="attr-base-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-href">href</A></CODE> attribute, then the
   <A href="http://dev.w3.org/html5/spec/Overview.html#document-base-url">document base URL</A> is <VAR title="">fallback base
   url</VAR>.</P></LI>

   <LI><P>Otherwise, let <VAR title="">url</VAR> be the value of the
   <CODE title="attr-base-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-href">href</A></CODE> attribute of the first
   such element.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a URL">Resolve</A> <VAR title="">url</VAR> relative to <VAR title="">fallback base
   url</VAR> (thus, the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> <CODE title="attr-base-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-href">href</A></CODE> attribute isn't affected by
   <CODE title="attr-xml-base"><A href="http://dev.w3.org/html5/spec/Overview.html#the-xml:base-attribute-xml-only">xml:base</A></CODE> attributes).</P></LI>

   <LI><P>The <A href="http://dev.w3.org/html5/spec/Overview.html#document-base-url">document base URL</A> is the result of the
   previous step if it was successful; otherwise it is <VAR title="">fallback base url</VAR>.</P></LI>

  </OL><P>This specification defines the URL
  <DFN id="about:legacy-compat"><CODE>about:legacy-compat</CODE></DFN> as a reserved, though
  unresolvable, <CODE title="">about:</CODE> URI, for use in <A href="http://dev.w3.org/html5/spec/Overview.html#syntax-doctype" title="syntax-doctype">DOCTYPE</A>s in <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML
  documents</A> when needed for compatibility with XML tools. <A href="http://dev.w3.org/html5/spec/Overview.html#refsABOUT">[ABOUT]</A></P>

  <P>This specification defines the URL
  <DFN id="about:srcdoc"><CODE>about:srcdoc</CODE></DFN> as a reserved, though
  unresolvable, <CODE title="">about:</CODE> URI, that is used as
  <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A> of <A href="http://dev.w3.org/html5/spec/Overview.html#an-iframe-srcdoc-document" title="an iframe srcdoc
  document"><CODE>iframe</CODE> <CODE title="attr-iframe-srcdoc">srcdoc</CODE> documents</A>. <A href="http://dev.w3.org/html5/spec/Overview.html#refsABOUT">[ABOUT]</A></P>

  </DIV><P class="note">The term "URL" in this specification is used in a
  manner distinct from the precise technical meaning it is given in
  RFC 3986. Readers familiar with that RFC will find it easier to read
  <EM>this</EM> specification if they pretend the term "URL" as used
  herein is really called something else altogether. This is a
  <A href="http://dev.w3.org/html5/spec/Overview.html#willful-violation">willful violation</A> of RFC 3986. <A href="http://dev.w3.org/html5/spec/Overview.html#refsRFC3986">[RFC3986]</A></P><DIV class="impl">

  <H4 id="dynamic-changes-to-base-urls"><SPAN class="secno">2.5.2 </SPAN>Dynamic changes to base URLs</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>When an <CODE title="attr-xml-base"><A href="http://dev.w3.org/html5/spec/Overview.html#the-xml:base-attribute-xml-only">xml:base</A></CODE> attribute
  changes, the attribute's element, and all descendant elements, are
  <A href="http://dev.w3.org/html5/spec/Overview.html#affected-by-a-base-url-change">affected by a base URL change</A>.</P>

  <P>When a document's <A href="http://dev.w3.org/html5/spec/Overview.html#document-base-url">document base URL</A> changes, all
  elements in that document are <A href="http://dev.w3.org/html5/spec/Overview.html#affected-by-a-base-url-change">affected by a base URL
  change</A>.</P>

  <P>When an element is moved from one document to another, if the two
  documents have different <A href="http://dev.w3.org/html5/spec/Overview.html#document-base-url" title="document base URL">base
  URLs</A>, then that element and all its descendants are
  <A href="http://dev.w3.org/html5/spec/Overview.html#affected-by-a-base-url-change">affected by a base URL change</A>.</P>

  <P>When an element is <DFN id="affected-by-a-base-url-change">affected by a base URL change</DFN>, it
  must act as described in the following list:</P>

  <DL class="switch"><DT>If the element is a <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink" title="hyperlink">hyperlink
   element</A></DT>

   <DD>

    <P>If the <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> identified by the hyperlink is
    being shown to the user, or if any data derived from that URL is
    affecting the display, then the <CODE title="attr-hyperlink-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-href">href</A></CODE> attribute should be <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a url">re-resolved</A> relative to the element
    and the UI updated appropriately.</P>

    <P class="example">For example, the CSS <CODE title="selector-link"><A href="http://dev.w3.org/html5/spec/Overview.html#selector-link">:link</A></CODE>/<CODE title="selector-visited"><A href="http://dev.w3.org/html5/spec/Overview.html#selector-visited">:visited</A></CODE> pseudo-classes might have
    been affected.</P>

    <P>If the hyperlink has a <CODE title="attr-hyperlink-ping"><A href="http://dev.w3.org/html5/spec/Overview.html#ping">ping</A></CODE> attribute and its <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url" title="absolute URL">absolute URL(s)</A> are being shown to the
    user, then the <CODE title="attr-hyperlink-ping"><A href="http://dev.w3.org/html5/spec/Overview.html#ping">ping</A></CODE>
    attribute's tokens should be <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a
    url">re-resolved</A> relative to the element and the UI updated
    appropriately.</P>

   </DD>

   <DT>If the element is a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-q-element">q</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-blockquote-element">blockquote</A></CODE>,
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-section-element">section</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-article-element">article</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE>, or
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE> element with a <CODE title="">cite</CODE>
   attribute</DT>

   <DD>

    <P>If the <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> identified by the <CODE title="">cite</CODE> attribute is being shown to the user, or if
    any data derived from that URL is affecting the display, then the
    <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A> should be <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a
    url">re-resolved</A> relative to the element and the UI updated
    appropriately.</P>

   </DD>

   <DT>Otherwise</DT>

   <DD>

    <P>The element is not directly affected.</P>

    <P class="example">Changing the base URL doesn't affect the image
    displayed by <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> elements, although subsequent
    accesses of the <CODE title="dom-img-src"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-img-src">src</A></CODE> IDL attribute
    from script will return a new <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> that might
    no longer correspond to the image being shown.</P>

   </DD>

  </DL></DIV><H4 id="interfaces-for-url-manipulation"><SPAN class="secno">2.5.3 </SPAN>Interfaces for URL manipulation</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>An interface that has a complement of <DFN id="url-decomposition-idl-attributes">URL decomposition IDL
  attributes</DFN> will have seven attributes with the following
  definitions:</P><PRE class="idl extract">           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-protocol" title="dom-uda-protocol">protocol</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-host" title="dom-uda-host">host</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-hostname" title="dom-uda-hostname">hostname</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-port" title="dom-uda-port">port</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-pathname" title="dom-uda-pathname">pathname</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-search" title="dom-uda-search">search</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-hash" title="dom-uda-hash">hash</A>;</PRE><DL class="domintro"><DT><VAR title="">o</VAR> . <CODE title="dom-uda-protocol"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-protocol">protocol</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the current scheme of the underlying URL.</P>
    <P>Can be set, to change the underlying URL's scheme.</P>
   </DD>

   <DT><VAR title="">o</VAR> . <CODE title="dom-uda-host"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-host">host</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the current host and port (if it's not the default port) in the underlying URL.</P>
    <P>Can be set, to change the underlying URL's host and port.</P>
    <P>The host and the port are separated by a colon. The port part,
    if omitted, will be assumed to be the current scheme's default
    port.</P>
   </DD>

   <DT><VAR title="">o</VAR> . <CODE title="dom-uda-hostname"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-hostname">hostname</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the current host in the underlying URL.</P>
    <P>Can be set, to change the underlying URL's host.</P>
   </DD>

   <DT><VAR title="">o</VAR> . <CODE title="dom-uda-port"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-port">port</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the current port in the underlying URL.</P>
    <P>Can be set, to change the underlying URL's port.</P>
   </DD>

   <DT><VAR title="">o</VAR> . <CODE title="dom-uda-pathname"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-pathname">pathname</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the current path in the underlying URL.</P>
    <P>Can be set, to change the underlying URL's path.</P>
   </DD>

   <DT><VAR title="">o</VAR> . <CODE title="dom-uda-search"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-search">search</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the current query component in the underlying URL.</P>
    <P>Can be set, to change the underlying URL's query component.</P>
   </DD>

   <DT><VAR title="">o</VAR> . <CODE title="dom-uda-hash"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-hash">hash</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the current fragment identifier in the underlying URL.</P>
    <P>Can be set, to change the underlying URL's fragment identifier.</P>
   </DD>

  </DL><DIV class="impl">

  <HR><P>The attributes defined to be URL decomposition IDL attributes must
  act as described for the attributes with the same corresponding
  names in this section.</P>

  <P>In addition, an interface with a complement of URL decomposition IDL
  attributes will define an <DFN id="concept-uda-input" title="concept-uda-input">input</DFN>, which is a <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A>
  that the attributes act on, and a <DFN id="concept-uda-setter" title="concept-uda-setter">common setter action</DFN>, which is a
  set of steps invoked when any of the attributes' setters are
  invoked.</P>

  <P>The seven URL decomposition IDL attributes have similar
  requirements.</P>

  <P>On getting, if the <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A>
  is an <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> that fulfills the condition given in
  the "getter condition" column corresponding to the attribute in the
  table below, the user agent must return the part of the <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> URL given in the "component"
  column, with any prefixes specified in the "prefix" column
  appropriately added to the start of the string and any suffixes
  specified in the "suffix" column appropriately added to the end of
  the string. Otherwise, the attribute must return the empty
  string.</P>

  <P>On setting, the new value must first be mutated as described by
  the "setter preprocessor" column, then mutated by %-escaping any
  characters in the new value that are not valid in the relevant
  component as given by the "component" column. Then, if the <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is an <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute
  URL</A> and the resulting new value fulfills the condition given
  in the "setter condition" column, the user agent must make a new
  string <VAR title="">output</VAR> by replacing the component of the
  URL given by the "component" column in the <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> URL with the new value;
  otherwise, the user agent must let <VAR title="">output</VAR> be
  equal to the <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A>. Finally,
  the user agent must invoke the <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-setter" title="concept-uda-setter">common setter action</A> with the
  value of <VAR title="">output</VAR>.</P>

  <P>When replacing a component in the URL, if the component is part
  of an optional group in the URL syntax consisting of a character
  followed by the component, the component (including its prefix
  character) must be included even if the new value is the empty
  string.</P>

  <P class="note">The previous paragraph applies in particular to the
  "<CODE title="">:</CODE>" before a &lt;port&gt; component, the "<CODE title="">?</CODE>" before a &lt;query&gt; component, and the "<CODE title="">#</CODE>" before a &lt;fragment&gt; component.</P>

  <P>For the purposes of the above definitions, URLs must be parsed
  using the <A href="http://dev.w3.org/html5/spec/Overview.html#parse-a-url" title="parse a URL">URL parsing rules</A> defined
  in this specification.</P>

  <TABLE><THEAD><TR><TH>Attribute
     </TH><TH>Component
     </TH><TH>Getter Condition
     </TH><TH>Prefix
     </TH><TH>Suffix
     </TH><TH>Setter Preprocessor
     </TH><TH>Setter Condition
   </TH></TR></THEAD><TBODY><TR><TD><DFN id="dom-uda-protocol" title="dom-uda-protocol"><CODE>protocol</CODE></DFN>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#url-scheme" title="url-scheme">&lt;scheme&gt;</A>
     </TD><TD>—
     </TD><TD>—
     </TD><TD>U+003A COLON (:)
     </TD><TD>Remove all trailing U+003A COLON characters (:)
     </TD><TD>The new value is not the empty string
    </TD></TR><TR><TD><DFN id="dom-uda-host" title="dom-uda-host"><CODE>host</CODE></DFN>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#url-hostport" title="url-hostport">&lt;hostport&gt;</A>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical and uses a server-based naming authority
     </TD><TD>—
     </TD><TD>—
     </TD><TD>—
     </TD><TD>The new value is not the empty string and <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical and uses a server-based naming authority
    </TD></TR><TR><TD><DFN id="dom-uda-hostname" title="dom-uda-hostname"><CODE>hostname</CODE></DFN>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#url-host" title="url-host">&lt;host&gt;</A>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical and uses a server-based naming authority
     </TD><TD>—
     </TD><TD>—
     </TD><TD>Remove all leading U+002F SOLIDUS characters (/)
     </TD><TD>The new value is not the empty string and <A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical and uses a server-based naming authority
    </TD></TR><TR><TD><DFN id="dom-uda-port" title="dom-uda-port"><CODE>port</CODE></DFN>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#url-port" title="url-port">&lt;port&gt;</A>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical, uses a server-based naming authority, and contained a <A href="http://dev.w3.org/html5/spec/Overview.html#url-port" title="url-port">&lt;port&gt;</A> component (possibly an empty one)
     </TD><TD>—
     </TD><TD>—
     </TD><TD>Remove all characters in the new value from the first that is not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), if any.
         Remove any leading U+0030 DIGIT ZERO characters (0) in the new value.
         If the resulting string is empty, set it to a single U+0030 DIGIT ZERO character (0).
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical and uses a server-based naming authority,
         and the new value, when interpretted as a base-ten integer, is less than or equal to 65535
    </TD></TR><TR><TD><DFN id="dom-uda-pathname" title="dom-uda-pathname"><CODE>pathname</CODE></DFN>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#url-path" title="url-path">&lt;path&gt;</A>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical
     </TD><TD>—
     </TD><TD>—
     </TD><TD>If it has no leading U+002F SOLIDUS character (/), prepend a U+002F SOLIDUS character (/) to the new value
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical
    </TD></TR><TR><TD><DFN id="dom-uda-search" title="dom-uda-search"><CODE>search</CODE></DFN>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#url-query" title="url-query">&lt;query&gt;</A>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical, and contained a <A href="http://dev.w3.org/html5/spec/Overview.html#url-query" title="url-query">&lt;query&gt;</A> component (possibly an empty one)
     </TD><TD>U+003F QUESTION MARK (?)
     </TD><TD>—
     </TD><TD>Remove one leading U+003F QUESTION MARK character (?), if any
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> is hierarchical
    </TD></TR><TR><TD><DFN id="dom-uda-hash" title="dom-uda-hash"><CODE>hash</CODE></DFN>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#url-fragment" title="url-fragment">&lt;fragment&gt;</A>
     </TD><TD><A href="http://dev.w3.org/html5/spec/Overview.html#concept-uda-input" title="concept-uda-input">input</A> contained a non-empty <A href="http://dev.w3.org/html5/spec/Overview.html#url-fragment" title="url-fragment">&lt;fragment&gt;</A> component
     </TD><TD>U+0023 NUMBER SIGN (#)
     </TD><TD>—
     </TD><TD>Remove one leading U+0023 NUMBER SIGN character (#), if any
     </TD><TD>—
  </TD></TR></TBODY></TABLE><!--
  http://www.hixie.ch/tests/adhoc/dom/level0/location/components/
  http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsLocation.cpp
  http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_h-l.htm#84722
--></DIV><DIV class="example">

   <P>The table below demonstrates how the getter <SPAN class="impl">condition</SPAN> for <CODE title="dom-uda-search"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-search">search</A></CODE> results in different results
   depending on the exact original syntax of the URL:</P>

   <TABLE><THEAD><TR><TH> Input URL
      </TH><TH> <CODE title="dom-uda-search"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-uda-search">search</A></CODE> value
      </TH><TH> Explanation
    </TH></TR></THEAD><TBODY><TR><TD> <CODE title="">http://example.com/</CODE>
      </TD><TD> <I>empty string</I>
      </TD><TD> No <A href="http://dev.w3.org/html5/spec/Overview.html#url-query" title="url-query">&lt;query&gt;</A> component in input URL.
     </TD></TR><TR><TD> <CODE title="">http://example.com/?</CODE>
      </TD><TD> <CODE title="">?</CODE>
      </TD><TD> There is a <A href="http://dev.w3.org/html5/spec/Overview.html#url-query" title="url-query">&lt;query&gt;</A> component, but it is empty.
           <SPAN class="impl">The question mark in the resulting value is the prefix.</SPAN>
     </TD></TR><TR><TD> <CODE title="">http://example.com/?test</CODE>
      </TD><TD> <CODE title="">?test</CODE>
      </TD><TD> The <A href="http://dev.w3.org/html5/spec/Overview.html#url-query" title="url-query">&lt;query&gt;</A> component has the value "<CODE title="">test</CODE>".
     </TD></TR><TR><TD> <CODE title="">http://example.com/?test#</CODE>
      </TD><TD> <CODE title="">?test</CODE>
      </TD><TD> The (empty) <A href="http://dev.w3.org/html5/spec/Overview.html#url-fragment" title="url-fragment">&lt;fragment&gt;</A> component is not part of the <A href="http://dev.w3.org/html5/spec/Overview.html#url-query" title="url-query">&lt;query&gt;</A> component.
   </TD></TR></TBODY></TABLE></DIV><DIV class="impl">

  <H3 id="fetching-resources"><SPAN class="secno">2.6 </SPAN>Fetching resources</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>When a user agent is to <DFN id="fetch">fetch</DFN> a resource or
  <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A>, optionally from an origin <I title="">origin</I>,
  the following steps must be run. (When a <EM>URL</EM> is to be
  fetched, the URL identifies a resource to be obtained.)</P>

  <OL><LI><P>If the resource is identified by the <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A>
   <DFN id="about:blank"><CODE>about:blank</CODE></DFN>, then return the empty string
   and abort these steps.</P></LI>

   <LI>

    <P>Generate the <I>address of the resource from which Request-URIs
    are obtained</I> as required by HTTP for the <CODE title="http-referer">Referer</CODE> (sic) header from <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-current-address">the
    document's current address</A> of the appropriate
    <CODE>Document</CODE> as given by the following list. <A href="http://dev.w3.org/html5/spec/Overview.html#refsHTTP">[HTTP]</A></P>

    <DL class="switch"><DT>When <A href="http://dev.w3.org/html5/spec/Overview.html#navigate" title="navigate">navigating</A></DT>

     <DD>The <A href="http://dev.w3.org/html5/spec/Overview.html#active-document">active document</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#source-browsing-context">source browsing
     context</A>.</DD>

     <DT>When fetching resources for an element</DT>

     <DD>The element's <CODE>Document</CODE>.</DD>

     <DT>When fetching resources in response to a call to an API</DT>

     <DD>The <A href="http://dev.w3.org/html5/spec/Overview.html#active-document">active document</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#script-s-browsing-context" title="script&#39;s
     browsing context">browsing context</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#entry-script">entry
     script</A>.</DD>

    </DL><P>Remove any <A href="http://dev.w3.org/html5/spec/Overview.html#url-fragment" title="url-fragment">&lt;fragment&gt;</A>
    component from the generated <I>address of the resource from which
    Request-URIs are obtained</I>.</P> <!-- RFC2616 says "The URI MUST
    NOT include a fragment." (section 14.36) -->

   </LI>

   <LI><P>Perform the remaining steps asynchronously.</P></LI>

   <LI>

    <P>If the resource is identified by an <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A>,
    and the resource is to be obtained using an idempotent action
    (such as an HTTP GET <A href="http://dev.w3.org/html5/spec/Overview.html#concept-http-equivalent-get" title="concept-http-equivalent-get">or
    equivalent</A>), and it is already being downloaded for other
    reasons (e.g. another invocation of this algorithm), and this
    request would be identical to the previous one (e.g. same <CODE title="http-accept">Accept</CODE> and <CODE title="http-origin">Origin</CODE> headers), and the user agent is
    configured such that it is to reuse the data from the existing
    download instead of initiating a new one, then use the results of
    the existing download instead of starting a new one.</P>

    <P>Otherwise, at a time convenient to the user and the user agent,
    download (or otherwise obtain) the resource, applying the
    semantics of the relevant specifications (e.g. performing an HTTP
    GET or POST operation, or reading the file from disk, following
    redirects, <A href="http://dev.w3.org/html5/spec/Overview.html#concept-js-deref" title="concept-js-deref">dereferencing <SPAN title="javascript protocol"><CODE title="">javascript:</CODE>
    URLs</SPAN></A>, etc).</P>

    <P>For the purposes of the <CODE title="http-referer">Referer</CODE> (sic) header, use the
    <I>address of the resource from which Request-URIs are
    obtained</I> generated in the earlier step.</P>

    <P>For the purposes of the <CODE title="http-origin">Origin</CODE>
    header, if the <A href="http://dev.w3.org/html5/spec/Overview.html#fetch" title="fetch">fetching algorithm</A> was
    explicitly initiated from an <I title="">origin</I>, then <I title="">the origin that initiated the HTTP request</I> is <I title="">origin</I>. Otherwise, this is <I title="">a request from
    a "privacy-sensitive" context</I>. <A href="http://dev.w3.org/html5/spec/Overview.html#refsORIGIN">[ORIGIN]</A></P>

   </LI>

   <LI>

    <P>If there are cookies to be set, then the user agent must run
    the following substeps:</P>

    <OL><LI><P>Wait until ownership of the <A href="http://dev.w3.org/html5/spec/Overview.html#storage-mutex">storage mutex</A> can
     be taken by this instance of the <A href="http://dev.w3.org/html5/spec/Overview.html#fetch" title="fetch">fetching</A> algorithm.</P></LI>

     <LI><P>Take ownership of the <A href="http://dev.w3.org/html5/spec/Overview.html#storage-mutex">storage mutex</A>.</P></LI>

     <LI><P>Update the cookies. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCOOKIES">[COOKIES]</A></P></LI>

     <LI><P>Release the <A href="http://dev.w3.org/html5/spec/Overview.html#storage-mutex">storage mutex</A> so that it is once
     again free.</P></LI>

    </OL></LI>

   <LI><P>When the resource is available, or if there is an error of
   some description, <A href="http://dev.w3.org/html5/spec/Overview.html#queue-a-task">queue a task</A> that uses the resource
   as appropriate. If the resource can be processed incrementally, as,
   for instance, with a progressively interlaced JPEG or an HTML file,
   additional tasks may be queued to process the data as it is
   downloaded. The <A href="http://dev.w3.org/html5/spec/Overview.html#task-source">task source</A> for these <A href="http://dev.w3.org/html5/spec/Overview.html#concept-task" title="concept-task">tasks</A> is the <A href="http://dev.w3.org/html5/spec/Overview.html#networking-task-source">networking task
   source</A>.</P>

  </LI></OL><P>If the user agent can determine the actual length of the resource
  being <A href="http://dev.w3.org/html5/spec/Overview.html#fetch" title="fetch">fetched</A> for an instance of this
  algorithm, and if that length is finite, then that length is the
  file's <DFN id="concept-fetch-total" title="concept-fetch-total">size</DFN>. Otherwise, the
  subject of the algorithm (that is, the resource being fetched) has
  no known <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fetch-total" title="concept-fetch-total">size</A>. (For
  example, the HTTP <CODE title="http-content-length">Content-Length</CODE> header might
  provide this information.)</P>

  <P>The user agent must also keep track of the <DFN id="concept-fetch-loaded" title="concept-fetch-loaded">number of bytes downloaded</DFN> for
  each instance of this algorithm. This number must exclude any
  out-of-band metadata, such as HTTP headers.</P>

  <P class="note">The <A href="http://dev.w3.org/html5/spec/Overview.html#application-cache">application cache</A> processing model
  introduces some <A href="http://dev.w3.org/html5/spec/Overview.html#changesToNetworkingModel">changes to the
  networking model</A> to handle the returning of cached
  resources.</P>

  <P class="note">The <A href="http://dev.w3.org/html5/spec/Overview.html#navigate" title="navigate">navigation</A>
  processing model handles redirects itself, overriding the
  redirection handling that would be done by the fetching
  algorithm.</P>

  <P class="note">Whether the <A href="http://dev.w3.org/html5/spec/Overview.html#content-type-sniffing">type
  sniffing rules</A> apply to the fetched resource depends on the
  algorithm that invokes the rules — they are not always
  applicable.</P>


  <H4 id="concept-http-equivalent"><SPAN class="secno">2.6.1 </SPAN>Protocol concepts</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>User agents can implement a variety of transfer protocols, but
  this specification mostly defines behavior in terms of HTTP. <A href="http://dev.w3.org/html5/spec/Overview.html#refsHTTP">[HTTP]</A></P>

  <P>The <DFN id="concept-http-equivalent-get" title="concept-http-equivalent-get">HTTP GET
  method</DFN> is equivalent to the default retrieval action of the
  protocol. For example, RETR in FTP. Such actions are idempotent and
  safe, in HTTP terms.</P>

  <P>The <DFN id="concept-http-equivalent-codes" title="concept-http-equivalent-codes">HTTP response
  codes</DFN> are equivalent to statuses in other protocols that have
  the same basic meanings. For example, a "file not found" error is
  equivalent to a 404 code, a server error is equivalent to a 5xx
  code, and so on.</P>

  <P>The <DFN id="concept-http-equivalent-headers" title="concept-http-equivalent-headers">HTTP
  headers</DFN> are equivalent to fields in other protocols that have
  the same basic meaning. For example, the HTTP authentication
  headers are equivalent to the authentication aspects of the FTP
  protocol.</P>


  <H4 id="encrypted-http-and-related-security-concerns"><SPAN class="secno">2.6.2 </SPAN>Encrypted HTTP and related security concerns</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>Anything in this specification that refers to HTTP also applies
  to HTTP-over-TLS, as represented by <A href="http://dev.w3.org/html5/spec/Overview.html#url" title="url">URLs</A>
  representing the <CODE title="">https</CODE> scheme.</P>

  <P class="warning">User agents should report certificate errors to
  the user and must either refuse to download resources sent with
  erroneous certificates or must act as if such resources were in fact
  served with no encryption.</P>

  <P>User agents should warn the user that there is a potential
  problem whenever the user visits a page that the user has previously
  visited, if the page uses less secure encryption on the second
  visit.</P>

  <P>Not doing so can result in users not noticing man-in-the-middle
  attacks.</P>

  <DIV class="example">

   <P>If a user connects to a server with a self-signed certificate,
   the user agent could allow the connection but just act as if there
   had been no encryption. If the user agent instead allowed the user
   to override the problem and then displayed the page as if it was
   fully and safely encrypted, the user could be easily tricked into
   accepting man-in-the-middle connections.</P>

   <P>If a user connects to a server with full encryption, but the
   page then refers to an external resource that has an expired
   certificate, then the user agent will act as if the resource was
   unavailable, possibly also reporting the problem to the user. If
   the user agent instead allowed the resource to be used, then an
   attacker could just look for "secure" sites that used resources
   from a different host and only apply man-in-the-middle attacks to
   that host, for example taking over scripts in the page.</P>

   <P>If a user bookmarks a site that uses a CA-signed certificate,
   and then later revisits that site directly but the site has started
   using a self-signed certificate, the user agent could warn the user
   that a man-in-the-middle attack is likely underway, instead of
   simply acting as if the page was not encrypted.</P>

  </DIV>


  <H4 id="content-type-sniffing"><SPAN class="secno">2.6.3 </SPAN>Determining the type of a resource</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>The <DFN id="content-type" title="Content-Type">Content-Type metadata</DFN> of a
  resource must be obtained and interpreted in a manner consistent
  with the requirements of the Content-Type Processing Model
  specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMIMESNIFF">[MIMESNIFF]</A></P>

  <P>The <DFN id="algorithm-for-extracting-an-encoding-from-a-content-type">algorithm for extracting an encoding from a
  Content-Type</DFN>, given a string <VAR title="">s</VAR>, is given
  in the Content-Type Processing Model specification. It either
  returns an encoding or nothing. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMIMESNIFF">[MIMESNIFF]</A></P>

  <P>The <DFN id="content-type-sniffing-0" title="Content-Type sniffing">sniffed type of a
  resource</DFN> must be found in a manner consistent with the
  requirements given in the Content-Type Processing Model
  specification for finding that <I>sniffed type</I>. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMIMESNIFF">[MIMESNIFF]</A></P>

  <P>The <DFN id="content-type-sniffing:-image" title="Content-Type sniffing: image">rules for sniffing
  images specifically</DFN> and the <DFN id="content-type-sniffing:-text-or-binary" title="Content-Type sniffing:
  text or binary">rules for distingushing if a resource is text or
  binary</DFN> are also defined in the Content-Type Processing Model
  specification. Both sets of rules return a <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type">MIME type</A> as
  their result. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMIMESNIFF">[MIMESNIFF]</A></P>

  <P class="warning">It is imperative that the rules in the
  Content-Type Processing Model specification be followed
  exactly. When a user agent uses different heuristics for content
  type detection than the server expects, security problems can
  occur. For more details, see the Content-Type Processing Model
  specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsMIMESNIFF">[MIMESNIFF]</A></P>

  </DIV><H3 id="common-dom-interfaces"><SPAN class="secno">2.7 </SPAN>Common DOM interfaces</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><H4 id="reflecting-content-attributes-in-idl-attributes"><SPAN class="secno">2.7.1 </SPAN>Reflecting content attributes in IDL attributes</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Some IDL attributes are defined to <DFN id="reflect">reflect</DFN> a
  particular content attribute. This means that on getting, the IDL
  attribute returns the current value of the content attribute, and on
  setting, the IDL attribute changes the value of the content
  attribute to the given value.</P><!-- v2 for completeness: (also search for REFLECTIDL)
  <p class="note">A list of <span>reflecting IDL attributes</span> and
  their corresponding content attributes is given in the index.</p>
--><DIV class="impl">

  <P>In general, on getting, if the content attribute is not present,
  the IDL attribute must act as if the content attribute's value is
  the empty string; and on setting, if the content attribute is not
  present, it must first be added.</P>

  <P>If a reflecting IDL attribute is a <CODE>DOMString</CODE>
  attribute whose content attribute is defined to contain a
  <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A>, then on getting, the IDL attribute must <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a url">resolve</A> the value of the content
  attribute relative to the element and return the resulting
  <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> if that was successful, or the empty
  string otherwise; and on setting, must set the content attribute to
  the specified literal value. If the content attribute is absent, the
  IDL attribute must return the default value, if the content
  attribute has one, or else the empty string.</P>

  <P>If a reflecting IDL attribute is a <CODE>DOMString</CODE>
  attribute whose content attribute is defined to contain one or more
  <A href="http://dev.w3.org/html5/spec/Overview.html#url" title="URL">URLs</A>, then on getting, the IDL attribute
  must <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a string on spaces">split the content
  attribute on spaces</A> and return the concatenation of <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a URL">resolving</A> each token URL to an
  <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A> relative to the element, with a single
  U+0020 SPACE character between each URL, ignoring any tokens that
  did not resolve successfully. If the content attribute is absent,
  the IDL attribute must return the default value, if the content
  attribute has one, or else the empty string. On setting, the IDL
  attribute must set the content attribute to the specified literal
  value.</P>

  <P>If a reflecting IDL attribute is a <CODE>DOMString</CODE> whose
  content attribute is an <A href="http://dev.w3.org/html5/spec/Overview.html#enumerated-attribute">enumerated attribute</A>, and the
  IDL attribute is <DFN id="limited-to-only-known-values">limited to only known values</DFN>, then, on
  getting, the IDL attribute must return the conforming value
  associated with the state the attribute is in (in its canonical
  case), or the empty string if the attribute is in a state that has
  no associated keyword value; and on setting, if the new value is an
  <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII case-insensitive</A> match for one of the keywords
  given for that attribute, then the content attribute must be set to
  the conforming value associated with the state that the attribute
  would be in if set to the given new value, otherwise, if the new
  value is the empty string, then the content attribute must be
  removed, otherwise, the setter must raise a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE>
  exception.</P>

  <P>If a reflecting IDL attribute is a <CODE>DOMString</CODE> but
  doesn't fall into any of the above categories, then the getting and
  setting must be done in a transparent, case-preserving manner.</P>

  <P>If a reflecting IDL attribute is a <A href="http://dev.w3.org/html5/spec/Overview.html#boolean-attribute">boolean
  attribute</A>, then on getting the IDL attribute must return true
  if the attribute is set, and false if it is absent. On setting, the
  content attribute must be removed if the IDL attribute is set to
  false, and must be set to have the same value as its name if the IDL
  attribute is set to true. (This corresponds to the rules for <A href="http://dev.w3.org/html5/spec/Overview.html#boolean-attribute" title="boolean attribute">boolean content attributes</A>.)</P>

  <P>If a reflecting IDL attribute is a signed integer type
  (<CODE>long</CODE>) then, on getting, the content attribute must be
  parsed according to the <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-integers" title="rules for parsing
  integers">rules for parsing signed integers</A>, and if that is
  successful, and the value is in the range of the IDL attribute's
  type, the resulting value must be returned. If, on the other hand,
  it fails or returns an out of range value, or if the attribute is
  absent, then the default value must be returned instead, or 0 if
  there is no default value. On setting, the given value must be
  converted to the shortest possible string representing the number as
  a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-integer">valid integer</A> and then that string must be used as
  the new content attribute value.</P>

  <P>If a reflecting IDL attribute is a signed integer type
  (<CODE>long</CODE>) that is <DFN id="limited-to-only-non-negative-numbers">limited to only non-negative
  numbers</DFN> then, on getting, the content attribute must be parsed
  according to the <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-non-negative-integers">rules for parsing non-negative
  integers</A>, and if that is successful, and the value is in the
  range of the IDL attribute's type, the resulting value must be
  returned. If, on the other hand, it fails or returns an out of range
  value, or if the attribute is absent, the default value must be
  returned instead, or −1 if there is no default value. On
  setting, if the value is negative, the user agent must fire an
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#index_size_err">INDEX_SIZE_ERR</A></CODE> exception. Otherwise, the given value
  must be converted to the shortest possible string representing the
  number as a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-non-negative-integer">valid non-negative integer</A> and then that
  string must be used as the new content attribute value.</P>

  <P>If a reflecting IDL attribute is an <EM>unsigned</EM> integer
  type (<CODE>unsigned long</CODE>) then, on getting, the content
  attribute must be parsed according to the <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-non-negative-integers">rules for parsing
  non-negative integers</A>, and if that is successful, and the
  value is in the range of the IDL attribute's type, the resulting
  value must be returned. If, on the other hand, it fails or returns
  an out of range value, or if the attribute is absent, the default
  value must be returned instead, or 0 if there is no default
  value. On setting, the given value must be converted to the shortest
  possible string representing the number as a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-non-negative-integer">valid
  non-negative integer</A> and then that string must be used as the
  new content attribute value.</P>

  <P>If a reflecting IDL attribute is an unsigned integer type
  (<CODE>unsigned long</CODE>) that is <DFN id="limited-to-only-non-negative-numbers-greater-than-zero">limited to only
  non-negative numbers greater than zero</DFN>, then the behavior is
  similar to the previous case, but zero is not allowed. On getting,
  the content attribute must first be parsed according to the
  <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</A>, and if that is
  successful, and the value is in the range of the IDL attribute's
  type, the resulting value must be returned. If, on the other hand,
  it fails or returns an out of range value, or if the attribute is
  absent, the default value must be returned instead, or 1 if there is
  no default value. On setting, if the value is zero, the user agent
  must fire an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#index_size_err">INDEX_SIZE_ERR</A></CODE> exception. Otherwise, the
  given value must be converted to the shortest possible string
  representing the number as a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-non-negative-integer">valid non-negative integer</A>
  and then that string must be used as the new content attribute
  value.</P>

  <P>If a reflecting IDL attribute is a floating point number type
  (<CODE>float</CODE>), then, on getting, the content attribute must
  be parsed according to the <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-floating-point-number-values">rules for parsing floating point
  number values</A>, and if that is successful, the resulting value
  must be returned. If, on the other hand, it fails, or if the
  attribute is absent, the default value must be returned instead, or
  0.0 if there is no default value. On setting, the given value must
  be converted to the <A href="http://dev.w3.org/html5/spec/Overview.html#best-representation-of-the-number-as-a-floating-point-number">best representation of the number as a
  floating point number</A> and then that string must be used as
  the new content attribute value.</P>

  <P class="note">The values Infinity and Not-a-Number (NaN) values
  throw an exception on setting, as <A href="http://dev.w3.org/html5/spec/Overview.html#float-nan">defined
  earlier</A>.</P>

  <P>If a reflecting IDL attribute is of the type
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> or <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domsettabletokenlist">DOMSettableTokenList</A></CODE>, then
  on getting it must return a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> or
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domsettabletokenlist">DOMSettableTokenList</A></CODE> object (as appropriate) whose
  underlying string is the element's corresponding content
  attribute. When the object mutates its underlying string, the
  content attribute must itself be immediately mutated. When the
  attribute is absent, then the string represented by the object is
  the empty string; when the object mutates this empty string, the
  user agent must add the corresponding content attribute, with its
  value set to the value it would have been set to after mutating the
  empty string. The same <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> or
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domsettabletokenlist">DOMSettableTokenList</A></CODE> object must be returned every time
  for each attribute.</P>

  <DIV class="example">

   <P>If an element with no attributes has its <CODE title="dom-tokenlist-remove"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-remove">element.classList.remove()</A></CODE>
   method invoked, the underlying string won't be changed, since the
   result of removing any token from the empty string is still the
   empty string. However, if the <CODE title="dom-tokenlist-add"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-add">element.classList.add()</A></CODE> method is
   then invoked, a <CODE title="attr-class"><A href="http://dev.w3.org/html5/spec/Overview.html#classes">class</A></CODE> attribute
   will be added to the element with the value of the token to be
   added.</P>

  </DIV>

  <P>If a reflecting IDL attribute has the type
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A></CODE>, or an interface that descends from
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A></CODE>, then, on getting, it must run the
  following algorithm (stopping at the first point where a value is
  returned):</P>

  <OL><LI>If the corresponding content attribute is absent, then the
   IDL attribute must return null.</LI>

   <LI>Let <VAR title="">candidate</VAR> be the element that the <CODE title="">document.getElementById()</CODE> method would find if it
   was passed as its argument the current value of the corresponding
   content attribute.</LI>

   <LI>If <VAR title="">candidate</VAR> is null, or if it is not
   type-compatible with the IDL attribute, then the IDL attribute must
   return null.</LI>

   <LI>Otherwise, it must return <VAR title="">candidate</VAR>.</LI>

  </OL><P>On setting, if the given element has an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute, then the content attribute must
  be set to the value of that <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE>
  attribute. Otherwise, the IDL attribute must be set to the empty
  string.</P>

  </DIV><H4 id="collections-0"><SPAN class="secno">2.7.2 </SPAN>Collections</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE>,
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlformcontrolscollection">HTMLFormControlsCollection</A></CODE>,
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection">HTMLOptionsCollection</A></CODE>, and
  <CODE>HTMLPropertiesCollection</CODE> interfaces represent various
  lists of DOM nodes. Collectively, objects implementing these
  interfaces are called <DFN id="collections">collections</DFN>.</P><P>When a <A href="http://dev.w3.org/html5/spec/Overview.html#collections" title="collections">collection</A> is created, a
  filter and a root are associated with the collection.</P><P class="example">For example, when the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE>
  object for the <CODE title="dom-document-images"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-images">document.images</A></CODE> attribute is
  created, it is associated with a filter that selects only
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> elements, and rooted at the root of the
  document.</P><P>The <A href="http://dev.w3.org/html5/spec/Overview.html#collections" title="collections">collection</A> then <DFN id="represented-by-the-collection" title="represented by the collection">represents</DFN> a
  <A href="http://dev.w3.org/html5/spec/Overview.html#live">live</A> view of the subtree rooted at the collection's
  root, containing only nodes that match the given filter. The view is
  linear. <SPAN class="impl">In the absence of specific requirements
  to the contrary, the nodes within the collection must be sorted in
  <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>.</SPAN></P><DIV class="impl">

  <P class="note">The <CODE title="dom-table-rows"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-table-rows">rows</A></CODE> list is
  not in tree order.</P>

  <P>An attribute that returns a collection must return the same
  object every time it is retrieved.</P>

  </DIV><H5 id="htmlcollection-0"><SPAN class="secno">2.7.2.1 </SPAN>HTMLCollection</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> interface represents a generic
  <A href="http://dev.w3.org/html5/spec/Overview.html#collections" title="collections">collection</A> of elements.</P><PRE class="idl">interface <DFN id="htmlcollection">HTMLCollection</DFN> {
  readonly attribute unsigned long <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-length" title="dom-HTMLCollection-length">length</A>;
  caller getter object <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</A>(in unsigned long index); // only returns Element
  caller getter object <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-nameditem" title="dom-HTMLCollection-namedItem">namedItem</A>(in DOMString name); // only returns Element
};</PRE><DL class="domintro"><DT><VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-length">length</A></CODE></DT>
   <DD>
    <P>Returns the number of elements in the collection.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-item"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item">item</A></CODE>(<VAR title="">index</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">index</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">index</VAR>)</DT>
   <DD>
    <P>Returns the item with index <VAR title="">index</VAR> from the collection. The items are sorted in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>.</P>
    <P>Returns null if <VAR title="">index</VAR> is out of range.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-item"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item">namedItem</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">name</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">name</VAR>)</DT>
   <DD>
    <P>Returns the first item with <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> or name <VAR title="">name</VAR>
    from the collection.</P>
    <P>Returns null if no element with that <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> or name could be found.</P>
    <P>Only <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE>,
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frame">frame</A></CODE>,
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE>, and
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> elements can have a name for the purpose of
    this method; their name is given by the value of their <CODE title="">name</CODE> attribute.</P>
   </DD>
  </DL><DIV class="impl">

  <P>The object's <SPAN>indices of the supported indexed
  properties</SPAN> are the numbers in the range zero to one less than
  the number of nodes <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the collection</A>. If
  there are no such elements, then there are no <SPAN>supported
  indexed properties</SPAN>.</P>

  <P>The <DFN id="dom-htmlcollection-length" title="dom-HTMLCollection-length"><CODE>length</CODE></DFN>
  attribute must return the number of nodes <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the
  collection</A>.</P>

  <P>The <DFN id="dom-htmlcollection-item" title="dom-HTMLCollection-item"><CODE>item(<VAR title="">index</VAR>)</CODE></DFN> method must return the <VAR title="">index</VAR>th node in the collection. If there is no <VAR title="">index</VAR>th node in the collection, then the method must
  return null.</P>

  <P>The <SPAN>names of the supported named properties</SPAN> consist
  of the values of the <CODE title="">name</CODE> attributes of each
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE>,
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frame">frame</A></CODE>,
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE>, and
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> element <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the
  collection</A> with a <CODE title="">name</CODE> attribute, plus
  the list of IDs that the elements <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the
  collection</A> have.</P>

  <P>The <DFN id="dom-htmlcollection-nameditem" title="dom-HTMLCollection-namedItem"><CODE>namedItem(<VAR title="">key</VAR>)</CODE></DFN> method must return the first node
  in the collection that matches the following requirements:</P>

  <UL><LI>It is an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE>,
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>,
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frame">frame</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE>,
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE>, or <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> element with a <CODE title="">name</CODE> attribute equal to <VAR title="">key</VAR>,
   or,</LI>

   <LI>It is an element with an <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A>
   equal to <VAR title="">key</VAR>.</LI>

  </UL><P>If no such elements are found, then the method must return
  null.</P>

  </DIV><H5 id="htmlallcollection-0"><SPAN class="secno">2.7.2.2 </SPAN>HTMLAllCollection</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE> interface represents a generic
  <A href="http://dev.w3.org/html5/spec/Overview.html#collections" title="collections">collection</A> of elements just like
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE>, with the exception that its <CODE title="dom-HTMLAllCollection-namedItem"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlallcollection-nameditem">namedItem()</A></CODE> method
  returns an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> object when there are
  multiple matching elements.</P><PRE class="idl">interface <DFN id="htmlallcollection">HTMLAllCollection</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> {
  // inherits <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-length" title="dom-HTMLCollection-length">length</A> and <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</A>()
  caller getter object <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlallcollection-nameditem" title="dom-HTMLAllCollection-namedItem">namedItem</A>(in DOMString name); // overrides inherited namedItem()
  <A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlallcollection-tags" title="dom-HTMLAllCollection-tags">tags</A>(in DOMString tagName);
};</PRE><DL class="domintro"><DT><VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-length">length</A></CODE></DT>
   <DD>
    <P>Returns the number of elements in the collection.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-item"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item">item</A></CODE>(<VAR title="">index</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">index</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">index</VAR>)</DT>
   <DD>
    <P>Returns the item with index <VAR title="">index</VAR> from the collection. The items are sorted in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>.</P>
    <P>Returns null if <VAR title="">index</VAR> is out of range.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLAllCollection-namedItem"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlallcollection-nameditem">namedItem</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DT><VAR title="">collection</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLAllCollection-namedItem"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlallcollection-nameditem">namedItem</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">name</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">name</VAR>)</DT>
   <DD>
    <P>Returns the item with <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> or name <VAR title="">name</VAR> from the collection.</P>
    <P>If there are multiple matching items, then an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE> object containing all those elements is returned.</P>
    <P>Returns null if no element with that <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> or name could be found.</P>
    <P>Only <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE>,
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frame">frame</A></CODE>,
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE>, and
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> elements can have a name for the purpose of
    this method; their name is given by the value of their <CODE title="">name</CODE> attribute.</P>
   </DD>

   <DT><VAR title="">collection</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLAllCollection-tags"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlallcollection-tags">tags</A></CODE>(<VAR title="">tagName</VAR>)</DT>
   <DD>
    <P>Returns a collection that is a filtered view of the current collection, containing only elements with the given tag name.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The object's <SPAN>indices of the supported indexed
  properties</SPAN> and <SPAN>names of the supported named
  properties</SPAN> are as defined for <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE>
  objects.</P>

  <P>The <DFN id="dom-htmlallcollection-nameditem" title="dom-HTMLAllCollection-namedItem"><CODE>namedItem(<VAR title="">key</VAR>)</CODE></DFN> method must act according to the
  following algorithm:</P>

  <OL><LI>

    <P>Let <VAR title="">collection</VAR> be an
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE> object rooted at the same node as
    the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE> object on which the method was
    invoked, whose filter matches only only elements that already
    match the filter of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE> object on
    which the method was invoked and that are either:</P>

    <UL><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE>,
     <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frame">frame</A></CODE>,
     <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE>, or
     <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> elements with a <CODE title="">name</CODE>
     attribute equal to <VAR title="">key</VAR>, or,</LI>

     <LI>elements with an <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> equal to
     <VAR title="">key</VAR>.</LI>

    </UL></LI>

   <LI>If, at the time the method is called, there is exactly one node
   in <VAR title="">collection</VAR>, then return that node and stop
   the algorithm.</LI>

   <LI>Otherwise, if, at the time the method is called, <VAR title="">collection</VAR> is empty, return null and stop the
   algorithm.</LI>

   <LI>Otherwise, return <VAR title="">collection</VAR>.</LI>

  </OL><P>The <DFN id="dom-htmlallcollection-tags" title="dom-HTMLAllCollection-tags"><CODE>tags(<VAR title="">tagName</VAR>)</CODE></DFN> method must return an
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE> rooted at the same node as the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE> object on which the method was
  invoked, whose filter matches only <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> whose
  local name is the <VAR title="">tagName</VAR> argument and that
  already match the filter of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlallcollection">HTMLAllCollection</A></CODE>
  object on which the method was invoked. In <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML
  documents</A>, the argument must first be <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase">converted to
  ASCII lowercase</A>.</P>

  </DIV><H5 id="htmlformcontrolscollection-0"><SPAN class="secno">2.7.2.3 </SPAN>HTMLFormControlsCollection</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlformcontrolscollection">HTMLFormControlsCollection</A></CODE> interface represents
  a <A href="http://dev.w3.org/html5/spec/Overview.html#collections" title="collections">collection</A> of <A href="http://dev.w3.org/html5/spec/Overview.html#category-listed" title="category-listed">listed</A> elements in <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>
  and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-fieldset-element">fieldset</A></CODE> elements.</P><PRE class="idl">interface <DFN id="htmlformcontrolscollection">HTMLFormControlsCollection</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> {
  // inherits <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-length" title="dom-HTMLCollection-length">length</A> and <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</A>()
  caller getter object <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlformcontrolscollection-nameditem" title="dom-HTMLFormControlsCollection-namedItem">namedItem</A>(in DOMString name); // overrides inherited namedItem()
};

interface <DFN id="radionodelist">RadioNodeList</DFN> : <SPAN>NodeList</SPAN> {
          attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-radionodelist-value" title="dom-RadioNodeList-value">value</A>;
};</PRE><DL class="domintro"><DT><VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-length">length</A></CODE></DT>
   <DD>
    <P>Returns the number of elements in the collection.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-item"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item">item</A></CODE>(<VAR title="">index</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">index</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">index</VAR>)</DT>
   <DD>
    <P>Returns the item with index <VAR title="">index</VAR> from the collection. The items are sorted in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>.</P>
    <P>Returns null if <VAR title="">index</VAR> is out of range.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLFormControlsCollection-namedItem"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlformcontrolscollection-nameditem">namedItem</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DT><VAR title="">radioNodeList</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLFormControlsCollection-namedItem"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlformcontrolscollection-nameditem">namedItem</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">name</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">name</VAR>)</DT>
   <DD>
    <P>Returns the item with <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> or <CODE title="attr-fe-name"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-fe-name">name</A></CODE> <VAR title="">name</VAR> from the collection.</P>
    <P>If there are multiple matching items, then a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> object containing all those elements is returned.</P>
    <P>Returns null if no element with that <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> or <CODE title="attr-fe-name"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-fe-name">name</A></CODE> could be found.</P>
   </DD>

   <DT><VAR title="">radioNodeList</VAR> . <VAR title="">value</VAR> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the value of the first checked radio button represented by the object.</P>
    <P>Can be set, to check the first radio button with the given value represented by the object.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The object's <SPAN>indices of the supported indexed
  properties</SPAN> are as defined for <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE>
  objects.</P>

  <P>The <SPAN>names of the supported named properties</SPAN> consist
  of the values of all the <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> and <CODE title="attr-fe-name"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-fe-name">name</A></CODE> attributes of all the elements
  <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the collection</A>.</P>

  <P>The <DFN id="dom-htmlformcontrolscollection-nameditem" title="dom-HTMLFormControlsCollection-namedItem"><CODE>namedItem(<VAR title="">name</VAR>)</CODE></DFN> method must act according to the
  following algorithm:</P>

  <OL><LI>If, at the time the method is called, there is exactly one node
   in the collection that has either an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute or a <CODE title="attr-fe-name"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-fe-name">name</A></CODE> attribute equal to <VAR title="">name</VAR>, then return that node and stop the
   algorithm.</LI>

   <LI>Otherwise, if there are no nodes in the collection that have
   either an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute or a <CODE title="attr-fe-name"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-fe-name">name</A></CODE> attribute equal to <VAR title="">name</VAR>, then return null and stop the algorithm.</LI>

   <LI>Otherwise, create a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> object
   representing a live view of the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlformcontrolscollection">HTMLFormControlsCollection</A></CODE> object, further filtered so
   that the only nodes in the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> object are
   those that have either an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute
   or a <CODE title="attr-fe-name"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-fe-name">name</A></CODE> attribute equal to <VAR title="">name</VAR>. The nodes in the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE>
   object must be sorted in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>.</LI>

   <LI>Return that <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> object.</LI>

  </OL><HR><P>Members of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> interface inherited
  from the <CODE>NodeList</CODE> interface must behave as they would
  on a <CODE>NodeList</CODE> object.</P>

  <P>The <DFN id="dom-radionodelist-value" title="dom-RadioNodeList-value"><CODE>value</CODE></DFN>
  IDL attribute on the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> object, on getting,
  must return the value returned by running the following steps:</P>

  <OL><LI><P>Let <VAR title="">element</VAR> be the first element in
   <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A> represented by the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> object that is an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE>
   element whose <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute
   is in the <A href="http://dev.w3.org/html5/spec/Overview.html#radio-button-state" title="attr-input-type-radio">Radio Button</A>
   state and whose <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fe-checked" title="concept-fe-checked">checkedness</A>
   is true. Otherwise, let it be null.</P></LI>

   <LI><P>If <VAR title="">element</VAR> is null, or if it is an
   element with no <CODE title="attr-input-value"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-value">value</A></CODE>
   attribute, return the empty string.</P></LI>

   <LI><P>Otherwise, return the value of <VAR title="">element</VAR>'s
   <CODE title="attr-input-value"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-value">value</A></CODE> attribute.</P></LI>

  </OL><P>On setting, the <CODE title="dom-RadioNodeList-value"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-radionodelist-value">value</A></CODE> IDL attribute must run
  the following steps:</P>

  <OL><LI><P>Let <VAR title="">element</VAR> be the first element in
   <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A> represented by the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#radionodelist">RadioNodeList</A></CODE> object that is an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE>
   element whose <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute
   is in the <A href="http://dev.w3.org/html5/spec/Overview.html#radio-button-state" title="attr-input-type-radio">Radio Button</A>
   state and whose <CODE title="attr-input-value"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-value">value</A></CODE> content
   attribute is present and equal to the new value, if any. Otherwise,
   let it be null.</P></LI>

   <LI><P>If <VAR title="">element</VAR> is not null, then set its
   <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fe-checked" title="concept-fe-checked">checkedness</A> to true.</P>

  </LI></OL><!--
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E...%0A%3Cform%20name%3D%22a%22%3E%3Cinput%20id%3D%22x%22%20name%3D%22y%22%3E%3Cinput%20name%3D%22x%22%20id%3D%22y%22%3E%3C/form%3E%0A%3Cscript%3E%0A%20%20var%20x%3B%0A%20%20w%28x%20%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20x%5B0%5D.parentNode.removeChild%28x%5B0%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20w%28x%20%3D%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%3C/script%3E%0A
--></DIV><H5 id="htmloptionscollection-0"><SPAN class="secno">2.7.2.4 </SPAN>HTMLOptionsCollection</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection">HTMLOptionsCollection</A></CODE> interface represents a
  list of <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element">option</A></CODE> elements. It is always rooted on a
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE> element and has attributes and methods that
  manipulate that element's descendants.</P><PRE class="idl">interface <DFN id="htmloptionscollection">HTMLOptionsCollection</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> {
  // inherits <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</A>()
           attribute unsigned long <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-length" title="dom-HTMLOptionsCollection-length">length</A>; // overrides inherited length
  caller getter object <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-nameditem" title="dom-HTMLOptionsCollection-namedItem">namedItem</A>(in DOMString name); // overrides inherited namedItem()
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add">add</A>(in <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> element, in optional <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> before);
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add">add</A>(in <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> element, in long before);
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-remove" title="dom-HTMLOptionsCollection-remove">remove</A>(in long index);
};</PRE><DL class="domintro"><DT><VAR title="">collection</VAR> . <CODE title="dom-HTMLOptionsCollection-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-length">length</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the number of elements in the collection.</P>
    <P>When set to a smaller number, truncates the number of <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element">option</A></CODE> elements in the corresponding container.</P>
    <P>When set to a greater number, adds new blank <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element">option</A></CODE> elements to that container.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLCollection-item"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmlcollection-item">item</A></CODE>(<VAR title="">index</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">index</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">index</VAR>)</DT>
   <DD>
    <P>Returns the item with index <VAR title="">index</VAR> from the collection. The items are sorted in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>.</P>
    <P>Returns null if <VAR title="">index</VAR> is out of range.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLOptionsCollection-namedItem"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-nameditem">namedItem</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DT><VAR title="">nodeList</VAR> = <VAR title="">collection</VAR> . <CODE title="dom-HTMLOptionsCollection-namedItem"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-nameditem">namedItem</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DT><VAR title="">collection</VAR>[<VAR title="">name</VAR>]</DT>
   <DT><VAR title="">collection</VAR>(<VAR title="">name</VAR>)</DT>
   <DD>
    <P>Returns the item with <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> or <CODE title="attr-option-name">name</CODE> <VAR title="">name</VAR> from the collection.</P>
    <P>If there are multiple matching items, then a <CODE>NodeList</CODE> object containing all those elements is returned.</P>
    <P>Returns null if no element with that <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">ID</A> could be found.</P>
   </DD>

   <DT><VAR title="">collection</VAR> . <CODE title="dom-HTMLOptionsCollection-add"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-add">add</A></CODE>(<VAR title="">element</VAR> [, <VAR title="">before</VAR> ] )</DT>
   <DD>
    <P>Inserts <VAR title="">element</VAR> before the node given by <VAR title="">before</VAR>.</P>
    <P>The <VAR title="">before</VAR> argument can be a number, in
    which case <VAR title="">element</VAR> is inserted before the item
    with that number, or an element from the collection, in which case
    <VAR title="">element</VAR> is inserted before that element.</P>
    <P>If <VAR title="">before</VAR> is omitted, null, or a number out
    of range, then <VAR title="">element</VAR> will be added at the
    end of the list.</P>
    <P>This method will throw a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#hierarchy_request_err">HIERARCHY_REQUEST_ERR</A></CODE>
    exception if <VAR title="">element</VAR> is an ancestor of the
    element into which it is to be inserted. If <VAR title="">element</VAR> is not an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element">option</A></CODE> or
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-optgroup-element">optgroup</A></CODE> element, then the method does nothing.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The object's <SPAN>indices of the supported indexed
  properties</SPAN> are as defined for <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE>
  objects.</P>

  <P>On getting, the <DFN id="dom-htmloptionscollection-length" title="dom-HTMLOptionsCollection-length"><CODE>length</CODE></DFN>
  attribute must return the number of nodes <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the
  collection</A>.</P>

  <P>On setting, the behavior depends on whether the new value is
  equal to, greater than, or less than the number of nodes
  <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the collection</A> at that time. If the
  number is the same, then setting the attribute must do nothing. If
  the new value is greater, then <VAR title="">n</VAR> new
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element">option</A></CODE> elements with no attributes and no child nodes
  must be appended to the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE> element on which the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection">HTMLOptionsCollection</A></CODE> is rooted, where <VAR title="">n</VAR> is the difference between the two numbers (new
  value minus old value). If the new value is lower, then the last
  <VAR title="">n</VAR> nodes in the collection must be removed from
  their parent nodes, where <VAR title="">n</VAR> is the difference
  between the two numbers (old value minus new value).</P>

  <P class="note">Setting <CODE title="dom-HTMLOptionsCollection-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-htmloptionscollection-length">length</A></CODE> never removes
  or adds any <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-optgroup-element">optgroup</A></CODE> elements, and never adds new
  children to existing <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-optgroup-element">optgroup</A></CODE> elements (though it can
  remove children from them).</P>

  <P>The <SPAN>names of the supported named properties</SPAN> consist
  of the values of all the <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> and <CODE title="attr-option-name">name</CODE> attributes of all the elements
  <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the collection</A>.</P>

  <P>The <DFN id="dom-htmloptionscollection-nameditem" title="dom-HTMLOptionsCollection-namedItem"><CODE>namedItem(<VAR title="">name</VAR>)</CODE></DFN> method must act according to the
  following algorithm:</P>

  <OL><LI>If, at the time the method is called, there is exactly one node
   in the collection that has either an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute or a <CODE title="attr-option-name">name</CODE> attribute equal to <VAR title="">name</VAR>, then return that node and stop the
   algorithm.</LI>

   <LI>Otherwise, if there are no nodes in the collection that have
   either an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute or a <CODE title="attr-option-name">name</CODE> attribute equal to <VAR title="">name</VAR>, then return null and stop the algorithm.</LI>

   <!-- IE returns an HTMLCollection instead; we may need to change to that for compat -->
   <LI>Otherwise, create a <CODE>NodeList</CODE> object representing a
   live view of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection">HTMLOptionsCollection</A></CODE> object, further
   filtered so that the only nodes in the <CODE>NodeList</CODE> object
   are those that have either an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE>
   attribute or a <CODE title="attr-option-name">name</CODE> attribute
   equal to <VAR title="">name</VAR>. The nodes in the
   <CODE>NodeList</CODE> object must be sorted in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree
   order</A>.</LI>

   <LI>Return that <CODE>NodeList</CODE> object.</LI>

  </OL><P>The <DFN id="dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add"><CODE>add(<VAR title="">element</VAR>, <VAR title="">before</VAR>)</CODE></DFN>
  method must act according to the following algorithm:</P>

  <OL><LI><P>If <VAR title="">element</VAR> is not an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element">option</A></CODE>
   or <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-optgroup-element">optgroup</A></CODE> element, then return and abort these
   steps.</P></LI>

   <LI><P>If <VAR title="">element</VAR> is an ancestor of the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE> element on which the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection">HTMLOptionsCollection</A></CODE> is rooted, then throw a
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#hierarchy_request_err">HIERARCHY_REQUEST_ERR</A></CODE> exception.</P></LI>

   <LI><P>If <VAR title="">before</VAR> is an element, but that
   element isn't a descendant of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE> element on
   which the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection">HTMLOptionsCollection</A></CODE> is rooted, then throw
   a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#not_found_err">NOT_FOUND_ERR</A></CODE> exception.</P></LI>

   <LI><P>If <VAR title="">element</VAR> and <VAR title="">before</VAR> are the same element, then return and abort
   these steps.</P></LI>

   <LI><P>If <VAR title="">before</VAR> is a node, then let <VAR title="">reference</VAR> be that node. Otherwise, if <VAR title="">before</VAR> is an integer, and there is a <VAR title="">before</VAR>th node in the collection, let <VAR title="">reference</VAR> be that node. Otherwise, let <VAR title="">reference</VAR> be null.</P></LI>

   <LI><P>If <VAR title="">reference</VAR> is not null, let <VAR title="">parent</VAR> be the parent node of <VAR title="">reference</VAR>. Otherwise, let <VAR title="">parent</VAR>
   be the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE> element on which the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmloptionscollection">HTMLOptionsCollection</A></CODE> is rooted.</P></LI>

   <LI><P>Act as if the DOM Core <CODE title="dom-insertBefore">insertBefore()</CODE> method was invoked
   on the <VAR title="">parent</VAR> node, with <VAR title="">element</VAR> as the first argument and <VAR title="">reference</VAR> as the second argument.</P>

  </LI></OL><P>The <DFN id="dom-htmloptionscollection-remove" title="dom-HTMLOptionsCollection-remove"><CODE>remove(<VAR title="">index</VAR>)</CODE></DFN> method must act according to
  the following algorithm:</P>

  <OL><LI><P>If the number of nodes <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by the
   collection</A> is zero, abort these steps.</P></LI>

   <LI><P>If <VAR title="">index</VAR> is not a number greater than or
   equal to 0 and less than the number of nodes <A href="http://dev.w3.org/html5/spec/Overview.html#represented-by-the-collection">represented by
   the collection</A>, let <VAR title="">element</VAR> be the first
   element in the collection. Otherwise, let <VAR title="">element</VAR> be the <VAR title="">index</VAR>th element
   in the collection.</P></LI>

   <LI><P>Remove <VAR title="">element</VAR> from its parent
   node.</P></LI>

  </OL><!-- see also http://ln.hixie.ch/?start=1161042744&count=1 --></DIV><H4 id="domtokenlist-0"><SPAN class="secno">2.7.3 </SPAN>DOMTokenList</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> interface represents an interface
  to an underlying string that consists of a <A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens">set of
  space-separated tokens</A>.</P><P class="note"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> objects are always
  <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A>, even when the underlying string might
  ordinarily be treated in a case-insensitive manner.</P><PRE class="idl">interface <DFN id="domtokenlist">DOMTokenList</DFN> {
  readonly attribute unsigned long <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-length" title="dom-tokenlist-length">length</A>;
  getter DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-item" title="dom-tokenlist-item">item</A>(in unsigned long index);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-contains" title="dom-tokenlist-contains">contains</A>(in DOMString token);
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-add" title="dom-tokenlist-add">add</A>(in DOMString token);
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-remove" title="dom-tokenlist-remove">remove</A>(in DOMString token);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-toggle" title="dom-tokenlist-toggle">toggle</A>(in DOMString token);
  <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-tostring" title="dom-tokenlist-toString">stringifier</A> DOMString ();
};</PRE><DL class="domintro"><DT><VAR title="">tokenlist</VAR> . <CODE title="dom-tokenlist-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-length">length</A></CODE></DT>
   <DD>
    <P>Returns the number of tokens in the string.</P>
   </DD>

   <DT><VAR title="">element</VAR> = <VAR title="">tokenlist</VAR> . <CODE title="dom-tokenlist-item"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-item">item</A></CODE>(<VAR title="">index</VAR>)</DT>
   <DT><VAR title="">tokenlist</VAR>[<VAR title="">index</VAR>]</DT>
   <DD>
    <P>Returns the token with index <VAR title="">index</VAR>. The tokens are returned in the order they are found in the underlying string.</P>
    <P>Returns null if <VAR title="">index</VAR> is out of range.</P>
   </DD>

   <DT><VAR title="">hastoken</VAR> = <VAR title="">tokenlist</VAR> . <CODE title="dom-tokenlist-contains"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-contains">contains</A></CODE>(<VAR title="">token</VAR>)</DT>
   <DD>
    <P>Returns true if the <VAR title="">token</VAR> is present; false otherwise.</P>
    <P>Throws a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception if <VAR title="">token</VAR> is empty.</P>
    <P>Throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception if <VAR title="">token</VAR> contains any spaces.</P>
   </DD>

   <DT><VAR title="">tokenlist</VAR> . <CODE title="dom-tokenlist-add"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-add">add</A></CODE>(<VAR title="">token</VAR>)</DT>
   <DD>
    <P>Adds <VAR title="">token</VAR>, unless it is already present.</P>
    <P>Throws a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception if <VAR title="">token</VAR> is empty.</P>
    <P>Throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception if <VAR title="">token</VAR> contains any spaces.</P>
   </DD>

   <DT><VAR title="">tokenlist</VAR> . <CODE title="dom-tokenlist-remove"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-remove">remove</A></CODE>(<VAR title="">token</VAR>)</DT>
   <DD>
    <P>Removes <VAR title="">token</VAR> if it is present.</P>
    <P>Throws a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception if <VAR title="">token</VAR> is empty.</P>
    <P>Throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception if <VAR title="">token</VAR> contains any spaces.</P>
   </DD>

   <DT><VAR title="">hastoken</VAR> = <VAR title="">tokenlist</VAR> . <CODE title="dom-tokenlist-toggle"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-toggle">toggle</A></CODE>(<VAR title="">token</VAR>)</DT>
   <DD>
    <P>Adds <VAR title="">token</VAR> if it is not present, or removes
    it if it is. Returns true if <VAR title="">token</VAR> is now
    present (it was added); returns false if it is not (it was
    removed).</P>
    <P>Throws a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception if <VAR title="">token</VAR> is empty.</P>
    <P>Throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception if <VAR title="">token</VAR> contains any spaces.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-tokenlist-length" title="dom-tokenlist-length"><CODE>length</CODE></DFN>
  attribute must return the number of tokens that result from <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a string on spaces">splitting the underlying string on
  spaces</A>. This is the <VAR title="dom-tokenlist-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-length">length</A></VAR>.</P>

  <P>The object's <SPAN>indices of the supported indexed
  properties</SPAN> are the numbers in the range zero to <SPAN title=""><VAR title="dom-tokenlist-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-length">length</A></VAR>-1</SPAN>, unless the <VAR title="dom-tokenlist-length"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-tokenlist-length">length</A></VAR> is zero, in which case
  there are no <SPAN>supported indexed properties</SPAN>.</P>

  <P>The <DFN id="dom-tokenlist-item" title="dom-tokenlist-item"><CODE>item(<VAR title="">index</VAR>)</CODE></DFN> method must <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a
  string on spaces">split the underlying string on spaces</A>,
  preserving the order of the tokens as found in the underlying
  string, and then return the <VAR title="">index</VAR>th item in this
  list. If <VAR title="">index</VAR> is equal to or greater than the
  number of tokens, then the method must return null.</P>

  <P class="example">For example, if the string is "<CODE title="">a b
  a c</CODE>" then there are four tokens: the token with index 0 is
  "<CODE title="">a</CODE>", the token with index 1 is "<CODE title="">b</CODE>", the token with index 2 is "<CODE title="">a</CODE>", and the token with index 3 is "<CODE title="">c</CODE>".</P>

  <P>The <DFN id="dom-tokenlist-contains" title="dom-tokenlist-contains"><CODE>contains(<VAR title="">token</VAR>)</CODE></DFN> method must run the following
  algorithm:</P>

  <OL><LI>If the <VAR title="">token</VAR> argument is the empty string,
   then raise a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>If the <VAR title="">token</VAR> argument contains any <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>, then raise an
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>Otherwise, <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a string on spaces">split the
   underlying string on spaces</A> to get the list of tokens in the
   object's underlying string.</LI>

   <LI>If the token indicated by <VAR title="">token</VAR> is a
   <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A> match for one of the tokens in the
   object's underlying string then return true and stop this
   algorithm.</LI>

   <LI>Otherwise, return false.</LI>

  </OL><P>The <DFN id="dom-tokenlist-add" title="dom-tokenlist-add"><CODE>add(<VAR title="">token</VAR>)</CODE></DFN> method must run the following
  algorithm:</P>

  <OL><LI>If the <VAR title="">token</VAR> argument is the empty string,
   then raise a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>If the <VAR title="">token</VAR> argument contains any <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>, then raise an
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>Otherwise, <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a string on spaces">split the
   underlying string on spaces</A> to get the list of tokens in the
   object's underlying string.</LI>

   <LI>If the given <VAR title="">token</VAR> is a
   <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A> match for one of the tokens in the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> object's underlying string then stop the
   algorithm.</LI>

   <LI>Otherwise, if the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> object's underlying
   string is not the empty string and the last character of that
   string is not a <A href="http://dev.w3.org/html5/spec/Overview.html#space-character">space character</A>, then append a U+0020
   SPACE character to the end of that string.</LI>

   <LI>Append the value of <VAR title="">token</VAR> to the end of the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> object's underlying string.</LI>

  </OL><P>The <DFN id="dom-tokenlist-remove" title="dom-tokenlist-remove"><CODE>remove(<VAR title="">token</VAR>)</CODE></DFN> method must run the following
  algorithm:</P>

  <OL><LI>If the <VAR title="">token</VAR> argument is the empty string,
   then raise a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>If the <VAR title="">token</VAR> argument contains any <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>, then raise an
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>Otherwise, <A href="http://dev.w3.org/html5/spec/Overview.html#remove-a-token-from-a-string" title="remove a token from a string">remove
   the given <VAR title="">token</VAR> from the underlying
   string</A>.</LI>

  </OL><P>The <DFN id="dom-tokenlist-toggle" title="dom-tokenlist-toggle"><CODE>toggle(<VAR title="">token</VAR>)</CODE></DFN> method must run the following
  algorithm:</P>

  <OL><LI>If the <VAR title="">token</VAR> argument is the empty string,
   then raise a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>If the <VAR title="">token</VAR> argument contains any <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A>, then raise an
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_character_err">INVALID_CHARACTER_ERR</A></CODE> exception and stop the
   algorithm.</LI>

   <LI>Otherwise, <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a string on spaces">split the
   underlying string on spaces</A> to get the list of tokens in the
   object's underlying string.</LI>

   <LI>If the given <VAR title="">token</VAR> is a
   <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A> match for one of the tokens in the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> object's underlying string then <A href="http://dev.w3.org/html5/spec/Overview.html#remove-a-token-from-a-string" title="remove a token from a string">remove the given <VAR title="">token</VAR> from the underlying string</A> and stop the
   algorithm, returning false.</LI>

   <LI>Otherwise, if the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> object's underlying
   string is not the empty string and the last character of that
   string is not a <A href="http://dev.w3.org/html5/spec/Overview.html#space-character">space character</A>, then append a U+0020
   SPACE character to the end of that string.</LI>

   <LI>Append the value of <VAR title="">token</VAR> to the end of the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> object's underlying string.</LI>

   <LI>Return true.</LI>

  </OL><P>Objects implementing the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> interface must
  <DFN id="dom-tokenlist-tostring" title="dom-tokenlist-toString">stringify</DFN> to the object's
  underlying string representation.</P>

  </DIV><H4 id="domsettabletokenlist-0"><SPAN class="secno">2.7.4 </SPAN>DOMSettableTokenList</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domsettabletokenlist">DOMSettableTokenList</A></CODE> interface is the same as the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE> interface, except that it allows the
  underlying string to be directly changed.</P><PRE class="idl">interface <DFN id="domsettabletokenlist">DOMSettableTokenList</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A> {
            attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</A>;
};</PRE><DL class="domintro"><DT><VAR title="">tokenlist</VAR> . <CODE title="dom-DOMSettableTokenList-value"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-domsettabletokenlist-value">value</A></CODE></DT>
   <DD>
    <P>Returns the underlying string.</P>
    <P>Can be set, to change the underlying string.</P>
   </DD>

  </DL><DIV class="impl">

  <P>An object implementing the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domsettabletokenlist">DOMSettableTokenList</A></CODE>
  interface must act as defined for the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A></CODE>
  interface, except for the <CODE title="dom-DOMSettableTokenList-value"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-domsettabletokenlist-value">value</A></CODE> attribute defined
  here.</P>

  <P>The <DFN id="dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value"><CODE>value</CODE></DFN>
  attribute must return the underlying string on getting, and must
  replace the underlying string with the new value on setting.</P>

  </DIV><DIV class="impl">

  <H4 id="safe-passing-of-structured-data"><SPAN class="secno">2.7.5 </SPAN>Safe passing of structured data</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>When a user agent is required to obtain a <DFN id="structured-clone">structured
  clone</DFN> of an object, it must run the following algorithm, which
  either returns a separate object, or throws an exception.</P>

  <OL><LI><P>Let <VAR title="">input</VAR> be the object being
   cloned.</P></LI>

   <LI><P>Let <VAR title="">memory</VAR> be a list of objects,
   initially empty. (This is used to catch cycles.)</P></LI>

   <LI><P>Let <VAR title="">output</VAR> be the object resulting from
   calling the <A href="http://dev.w3.org/html5/spec/Overview.html#internal-structured-cloning-algorithm">internal structured cloning algorithm</A> with
   <VAR title="">input</VAR> and <VAR title="">memory</VAR>.</P></LI>

   <LI><P>Return <VAR title="">output</VAR>.</P></LI>

  </OL><P>The <DFN id="internal-structured-cloning-algorithm">internal structured cloning algorithm</DFN> is always
  called with two arguments, <VAR title="">input</VAR> and <VAR title="">memory</VAR>, and its behavior depends on the type of <VAR title="">input</VAR>, as follows:</P>

  <DL class="switch"><DT>If <VAR title="">input</VAR> is the undefined value</DT>

   <DD><P>Return the undefined value.</P></DD>

   <DT>If <VAR title="">input</VAR> is the null value</DT>

   <DD><P>Return the null value.</P></DD>

   <DT>If <VAR title="">input</VAR> is the false value</DT>

   <DD><P>Return the false value.</P></DD>

   <DT>If <VAR title="">input</VAR> is the true value</DT>

   <DD><P>Return the true value.</P></DD>

   <DT>If <VAR title="">input</VAR> is a Number object</DT>

   <DD><P>Return a newly constructed Number object with the same value as <VAR title="">input</VAR>.</P></DD>

   <DT>If <VAR title="">input</VAR> is a String object</DT>

   <DD><P>Return a newly constructed String object with the same value as <VAR title="">input</VAR>.</P></DD>

   <DT>If <VAR title="">input</VAR> is a <CODE>Date</CODE> object</DT>

   <DD><P>Return a newly constructed <CODE>Date</CODE> object with the same value as <VAR title="">input</VAR>.</P></DD>

   <DT>If <VAR title="">input</VAR> is a <CODE>RegExp</CODE> object</DT>

   <DD>

    <P>Return a newly constructed <CODE>RegExp</CODE> object with the same pattern and flags as <VAR title="">input</VAR>.</P>

    <P class="note">The value of the <CODE title="">lastIndex</CODE> property is not copied.</P>

   </DD>

   <DT>If <VAR title="">input</VAR> is a <CODE>ImageData</CODE> object</DT>

   <DD><P>Return a newly constructed <CODE>ImageData</CODE> object
   with the same <CODE title="dom-imagedata-width">width</CODE> and
   <CODE title="dom-imagedata-height">height</CODE> as <VAR title="">input</VAR>, and with a newly constructed
   <CODE>CanvasPixelArray</CODE> for its <CODE title="dom-imagedata-data">data</CODE> attribute, with the same
   <CODE title="dom-canvaspixelarray-length">length</CODE> and pixel
   values as the <VAR title="">input</VAR>'s.</P></DD>

   <DT>If <VAR title="">input</VAR> is a <CODE>File</CODE> object</DT>

   <DD><P>Return a newly constructed <CODE>File</CODE> object corresponding to the same underlying data.</P></DD>

   <DT>If <VAR title="">input</VAR> is a <CODE>Blob</CODE> object</DT>

   <DD><P>Return a newly constructed <CODE>Blob</CODE> object corresponding to the same underlying data.</P></DD>

   <DT>If <VAR title="">input</VAR> is a <CODE>FileList</CODE> object</DT>

   <DD><P>Return a newly constructed <CODE>FileList</CODE> object containing a list of newly constructed <CODE>File</CODE> objects corresponding to the same underlying data as those in <VAR title="">input</VAR>, maintaining their relative order.</P></DD>

   <DT>If <VAR title="">input</VAR> is a host object (e.g. a DOM node)</DT>

   <DD><P>Return the null value.</P></DD>

   <DT>If <VAR title="">input</VAR> is an Array object</DT>
   <DT>If <VAR title="">input</VAR> is an Object object</DT>

   <DD>

    <OL><LI><P>If <VAR title="">input</VAR> is in <VAR title="">memory</VAR>, then throw a
     <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#not_supported_err">NOT_SUPPORTED_ERR</A></CODE> exception and abort the overall
     <A href="http://dev.w3.org/html5/spec/Overview.html#structured-clone">structured clone</A> algorithm.</P></LI>

     <LI><P>Otherwise, let <VAR title="">new memory</VAR> be a list
     consisting of the items in <VAR title="">memory</VAR> with the
     addition of <VAR title="">input</VAR>.</P></LI>

     <LI><P>Create a new object, <VAR title="">output</VAR>, of the
     same type as <VAR title="">input</VAR>: either an Array or an
     Object.</P></LI>

     <LI>

      <P>For each enumerable property in <VAR title="">input</VAR>,
      add a corresponding property to <VAR title="">output</VAR>
      having the same name, and having a value created from invoking
      the <A href="http://dev.w3.org/html5/spec/Overview.html#internal-structured-cloning-algorithm">internal structured cloning algorithm</A>
      recursively with the value of the property as the "<VAR title="">input</VAR>" argument and <VAR title="">new
      memory</VAR> as the "<VAR title="">memory</VAR>" argument. The
      order of the properties in the <VAR title="">input</VAR> and
      <VAR title="">output</VAR> objects must be the same.</P>

      <P class="note">This does not walk the prototype chain.</P>

     </LI>

     <LI><P>Return <VAR title="">output</VAR>.</P></LI>

    </OL></DD>

   <DT>If <VAR title="">input</VAR> is another native object type (e.g. <CODE>Error</CODE>)</DT>

   <DD><P>Return the null value.</P></DD>

  </DL></DIV><H4 id="domstringmap-0"><SPAN class="secno">2.7.6 </SPAN>DOMStringMap</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> interface represents a set of
  name-value pairs. It exposes these using the scripting language's
  native mechanisms for property access.</P><DIV class="impl">

  <P>When a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> object is instantiated, it is
  associated with three algorithms, one for getting the list of
  name-value pairs, one for setting names to certain values, and one
  for deleting names.</P>

  <PRE class="idl">interface <DFN id="domstringmap">DOMStringMap</DFN> {
  getter DOMString (in DOMString name);
  setter void (in DOMString name, in DOMString value);
  creator void (in DOMString name, in DOMString value);
  deleter void (in DOMString name);
};</PRE>

  <P>The <SPAN>names of the supported named properties</SPAN> on a
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> object at any instant are the names of
  each pair returned from the algorithm for getting the list of
  name-value pairs at that instant.</P>

  <P>When a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> object is indexed to retrieve a
  named property <VAR title="">name</VAR>, the value returned must be
  the value component of the name-value pair whose name component is
  <VAR title="">name</VAR> in the list returned by the algorithm for
  getting the list of name-value pairs.</P>

  <P>When a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> object is indexed to create or
  modify a named property <VAR title="">name</VAR> with value <VAR title="">value</VAR>, the algorithm for setting names to certain
  values must be run, passing <VAR title="">name</VAR> as the name and
  the result of converting <VAR title="">value</VAR> to a
  <CODE>DOMString</CODE> as the value.</P>

  <P>When a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> object is indexed to delete a
  named property named <VAR title="">name</VAR>, the algorithm for
  deleting names must be run, passing <VAR title="">name</VAR> as the
  name.</P>

  <P class="note">The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> interface definition
  here is only intended for JavaScript environments. Other language
  bindings will need to define how <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> is to be
  implemented for those languages.</P>

  </DIV><DIV class="example">

   <P>The <CODE title="dom-dataset"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-dataset">dataset</A></CODE> attribute on
   elements exposes the <CODE title="attr-data-*"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-data">data-*</A></CODE>
   attributes on the element.</P>

   <P>Given the following fragment and elements with similar
   constructions:</P>

   <PRE>&lt;img class="tower" id="tower5" data-x="12" data-y="5"
     data-ai="robotarget" data-hp="46" data-ability="flames"
     src="towers/rocket.png alt="Rocket Tower"&gt;</PRE>

   <P>...one could imagine a function <CODE title="">splashDamage()</CODE> that takes some arguments, the first
   of which is the element to process:</P>

   <PRE>function splashDamage(node, x, y, damage) {
  if (node.classList.contains('tower') &amp;&amp; // checking the 'class' attribute
      node.dataset.x == x &amp;&amp; // reading the 'data-x' attribute
      node.dataset.y == y) { // reading the 'data-y' attribute
    var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
    hp = hp - damage;
    if (hp &lt; 0) {
      hp = 0;
      node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
      delete node.dataset.ability; // removing the 'data-ability' attribute
    }
    node.dataset.hp = hp; // setting the 'data-hp' attribute
  }
}</PRE>

  </DIV><H4 id="dom-feature-strings"><SPAN class="secno">2.7.7 </SPAN>DOM feature strings</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>DOM3 Core defines mechanisms for checking for interface support,
  and for obtaining implementations of interfaces, using <A href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMFeatures">feature
  strings</A>. <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMCORE]</A></P><P>Authors are strongly discouraged from using these, as they are
  notoriously unreliable and imprecise. Authors are encouraged to rely
  on explicit feature testing or the graceful degradation behavior
  intrinsic to some of the features in this specification.</P><DIV class="impl">

  <P>For historical reasons, user agents should return the true value
  when the <DFN id="hasfeature" title="hasFeature"><CODE>hasFeature(<VAR title="">feature</VAR>, <VAR title="">version</VAR>)</CODE></DFN>
  method of the <CODE>DOMImplementation</CODE> interface is invoked
  with <VAR title="">feature</VAR> set to either "<CODE title="">HTML</CODE>" or "<CODE title="">XHTML</CODE>" and <VAR title="">version</VAR> set to either "<CODE>1.0</CODE>" or
  "<CODE>2.0</CODE>".</P>

  </DIV><H4 id="exceptions"><SPAN class="secno">2.7.8 </SPAN>Exceptions</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The following are <CODE>DOMException</CODE> codes. <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMCORE]</A></P><OL class="brief"><LI value="1"><DFN id="index_size_err"><CODE>INDEX_SIZE_ERR</CODE></DFN></LI>
   <LI value="2"><DFN id="domstring_size_err"><CODE>DOMSTRING_SIZE_ERR</CODE></DFN></LI>
   <LI value="3"><DFN id="hierarchy_request_err"><CODE>HIERARCHY_REQUEST_ERR</CODE></DFN></LI>
   <LI value="4"><DFN id="wrong_document_err"><CODE>WRONG_DOCUMENT_ERR</CODE></DFN></LI>
   <LI value="5"><DFN id="invalid_character_err"><CODE>INVALID_CHARACTER_ERR</CODE></DFN></LI>
   <LI value="6"><DFN id="no_data_allowed_err"><CODE>NO_DATA_ALLOWED_ERR</CODE></DFN></LI>
   <LI value="7"><DFN id="no_modification_allowed_err"><CODE>NO_MODIFICATION_ALLOWED_ERR</CODE></DFN></LI>
   <LI value="8"><DFN id="not_found_err"><CODE>NOT_FOUND_ERR</CODE></DFN></LI>
   <LI value="9"><DFN id="not_supported_err"><CODE>NOT_SUPPORTED_ERR</CODE></DFN></LI>
   <LI value="10"><DFN id="inuse_attribute_err"><CODE>INUSE_ATTRIBUTE_ERR</CODE></DFN></LI>
   <LI value="11"><DFN id="invalid_state_err"><CODE>INVALID_STATE_ERR</CODE></DFN></LI>
   <LI value="12"><DFN id="syntax_err"><CODE>SYNTAX_ERR</CODE></DFN></LI>
   <LI value="13"><DFN id="invalid_modification_err"><CODE>INVALID_MODIFICATION_ERR</CODE></DFN></LI>
   <LI value="14"><DFN id="namespace_err"><CODE>NAMESPACE_ERR</CODE></DFN></LI>
   <LI value="15"><DFN id="invalid_access_err"><CODE>INVALID_ACCESS_ERR</CODE></DFN></LI>
   <LI value="16"><DFN id="validation_err"><CODE>VALIDATION_ERR</CODE></DFN></LI>
   <LI value="17"><DFN id="type_mismatch_err"><CODE>TYPE_MISMATCH_ERR</CODE></DFN></LI>
   <LI value="18"><DFN id="security_err"><CODE>SECURITY_ERR</CODE></DFN></LI> <!-- actually in XHR for now -->
   <LI value="19"><DFN id="network_err"><CODE>NETWORK_ERR</CODE></DFN></LI> <!-- actually in XHR for now -->
   <LI value="20"><DFN id="abort_err"><CODE>ABORT_ERR</CODE></DFN></LI> <!-- actually in XHR for now -->
   <LI value="21"><DFN id="url_mismatch_err"><CODE>URL_MISMATCH_ERR</CODE></DFN></LI> <!-- actually in workers for now -->
   <LI value="22"><DFN id="quota_exceeded_err"><CODE>QUOTA_EXCEEDED_ERR</CODE></DFN></LI> <!-- actually defined right here for now -->
<!--v2DATAGRID   <li value="23"><dfn><code>DATAGRID_MODEL_ERR</code></dfn></li> --> <!-- actually defined right here for now -->
   <LI value="81"><DFN id="parse_err"><CODE>PARSE_ERR</CODE></DFN></LI> <!-- actually defined in dom3ls -->
   <LI value="82"><DFN id="serialize_err"><CODE>SERIALIZE_ERR</CODE></DFN></LI> <!-- actually defined in dom3ls -->
  </OL><DIV class="impl">

  <H4 id="garbage-collection"><SPAN class="secno">2.7.9 </SPAN>Garbage collection</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P>There is an <DFN id="implied-strong-reference">implied strong reference</DFN> from any IDL
  attribute that returns a pre-existing object to that object.</P>

  <DIV class="example">

   <P>For example, the <CODE>document.location</CODE> attribute means
   that there is a strong reference from a <CODE>Document</CODE>
   object to its <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#location">Location</A></CODE> object. Similarly, there is
   always a strong reference from a <CODE>Document</CODE> to any
   descendant nodes, and from any node to its owner
   <CODE>Document</CODE>.</P>

  </DIV>

  </DIV><H3 id="namespaces"><SPAN class="secno">2.8 </SPAN>Namespaces</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <DFN id="html-namespace-0">HTML namespace</DFN> is: <CODE>http://www.w3.org/1999/xhtml</CODE></P><P>The <DFN id="mathml-namespace">MathML namespace</DFN> is: <CODE>http://www.w3.org/1998/Math/MathML</CODE></P><P>The <DFN id="svg-namespace">SVG namespace</DFN> is: <CODE>http://www.w3.org/2000/svg</CODE></P><P>The <DFN id="xlink-namespace">XLink namespace</DFN> is: <CODE>http://www.w3.org/1999/xlink</CODE></P><P>The <DFN id="xml-namespace">XML namespace</DFN> is: <CODE>http://www.w3.org/XML/1998/namespace</CODE></P><P>The <DFN id="xmlns-namespace">XMLNS namespace</DFN> is: <CODE>http://www.w3.org/2000/xmlns/</CODE></P><HR><P>Data mining tools and other user agents that perform operations
  on content without running scripts, evaluating CSS or XPath
  expressions, or otherwise exposing the resulting DOM to arbitrary
  content, may "support namespaces" by just asserting that their DOM
  node analogues are in certain namespaces, without actually exposing
  the above strings.</P><H2 id="dom"><SPAN class="secno">3 </SPAN>Semantics, structure, and APIs of HTML documents</H2><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><H3 id="documents"><SPAN class="secno">3.1 </SPAN>Documents</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Every XML and HTML document in an HTML UA is represented by a
  <CODE>Document</CODE> object. <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMCORE]</A></P><P><DFN id="the-document-s-address">The document's address</DFN> is an <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A>
  that is set when the <CODE>Document</CODE> is created. <DFN id="the-document-s-current-address">The
  document's current address</DFN> is an <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute URL</A>
  that can change during the lifetime of the <CODE>Document</CODE>,
  for example when the user <A href="http://dev.w3.org/html5/spec/Overview.html#navigate" title="navigate">navigates</A> to
  a <A href="http://dev.w3.org/html5/spec/Overview.html#scroll-to-fragid" title="navigate-fragid">fragment identifier</A> on the
  page. <SPAN class="impl"><A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-current-address">The document's current address</A>
  must be set to <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A> when the
  <CODE>Document</CODE> is created.</SPAN></P><P class="note">Interactive user agents typically expose <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-current-address">the
  document's current address</A> in their user interface.</P><P>When a <CODE>Document</CODE> is created by a <A href="http://dev.w3.org/html5/spec/Overview.html#concept-script" title="concept-script">script</A> using the <CODE title="dom-DOMImplementation-createDocument">createDocument()</CODE>
  or <CODE title="dom-DOMHTMLImplementation-createHTMLDocument"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-domhtmlimplementation-createhtmldocument">createHTMLDocument()</A></CODE>
  APIs, <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A> is the same as <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the
  document's address</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#active-document">active document</A> of the
  <A href="http://dev.w3.org/html5/spec/Overview.html#script-s-browsing-context">script's browsing context</A>.</P><P><CODE>Document</CODE> objects are assumed to be <DFN id="xml-documents">XML
  documents</DFN> unless they are flagged as being <DFN id="html-documents">HTML
  documents</DFN> when they are created. Whether a document is an
  <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML document</A> or an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML documents">XML document</A> affects the behavior of
  certain APIs and the case-sensitivity of some selectors.</P><H4 id="documents-in-the-dom"><SPAN class="secno">3.1.1 </SPAN>Documents in the DOM</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>All <CODE>Document</CODE> objects (in user agents implementing
  this specification) <SPAN class="impl">must</SPAN> also implement
  the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> interface, available using
  binding-specific methods. (This is the case whether or not the
  document in question is an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML
  document</A> or indeed whether it contains any <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML
  elements</A> at all.) <CODE>Document</CODE> objects <SPAN class="impl">must</SPAN> also implement the document-level interface
  of any other namespaces that the UA supports.</P><P class="example">For example, if an HTML implementation also
  supports SVG, then the <CODE>Document</CODE> object implements both
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> and <CODE>SVGDocument</CODE>.</P><P class="note">Because the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> interface is
  now obtained using binding-specific casting methods instead of
  simply being the primary interface of the document object, it is no
  longer defined as inheriting from <CODE>Document</CODE>.</P><PRE class="idl">[OverrideBuiltins]
interface <DFN id="htmldocument">HTMLDocument</DFN> {
  // <A href="http://dev.w3.org/html5/spec/Overview.html#resource-metadata-management">resource metadata management</A>
  [PutForwards=href] readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#location">Location</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-location" title="dom-document-location">location</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-url" title="dom-document-URL">URL</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-domain" title="dom-document-domain">domain</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-referrer" title="dom-document-referrer">referrer</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-cookie" title="dom-document-cookie">cookie</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-lastmodified" title="dom-document-lastModified">lastModified</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-compatmode" title="dom-document-compatMode">compatMode</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-charset" title="dom-document-charset">charset</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-characterset" title="dom-document-characterSet">characterSet</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-defaultcharset" title="dom-document-defaultCharset">defaultCharset</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-readystate" title="dom-document-readyState">readyState</A>;

  // <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tree-accessors">DOM tree accessors</A>
  <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-nameditem" title="dom-document-namedItem">getter</A> any (in DOMString name);
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#document.title" title="dom-document-title">title</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-dir" title="dom-document-dir">dir</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-body" title="dom-document-body">body</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlheadelement">HTMLHeadElement</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-head" title="dom-document-head">head</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-images" title="dom-document-images">images</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-embeds" title="dom-document-embeds">embeds</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-plugins" title="dom-document-plugins">plugins</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-links" title="dom-document-links">links</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-forms" title="dom-document-forms">forms</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-scripts" title="dom-document-scripts">scripts</A>;
  NodeList <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyname" title="dom-document-getElementsByName">getElementsByName</A>(in DOMString elementName);
  NodeList <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyclassname" title="dom-document-getElementsByClassName">getElementsByClassName</A>(in DOMString classNames);

  // <A href="http://dev.w3.org/html5/spec/Overview.html#dynamic-markup-insertion">dynamic markup insertion</A>
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml" title="dom-innerHTML">innerHTML</A>;
  <A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open" title="dom-document-open">open</A>(in optional DOMString type, in optional DOMString replace);
  <A href="http://dev.w3.org/html5/spec/Overview.html#windowproxy">WindowProxy</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open" title="dom-document-open">open</A>(in DOMString url, in DOMString name, in DOMString features, in optional boolean replace);
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-close" title="dom-document-close">close</A>();
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-write" title="dom-document-write">write</A>(in DOMString... text);
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-writeln" title="dom-document-writeln">writeln</A>(in DOMString... text);

  // <A href="http://dev.w3.org/html5/spec/Overview.html#editing">user interaction</A>
  <A href="http://dev.w3.org/html5/spec/Overview.html#selection-0">Selection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-getselection" title="dom-document-getSelection">getSelection</A>();
  readonly attribute <SPAN>Element</SPAN> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-activeelement" title="dom-document-activeElement">activeElement</A>;
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-hasfocus" title="dom-document-hasFocus">hasFocus</A>();
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#designMode" title="dom-document-designMode">designMode</A>;
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#execCommand" title="dom-document-execCommand">execCommand</A>(in DOMString commandId);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#execCommand" title="dom-document-execCommand">execCommand</A>(in DOMString commandId, in boolean showUI);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#execCommand" title="dom-document-execCommand">execCommand</A>(in DOMString commandId, in boolean showUI, in DOMString value);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-querycommandenabled" title="dom-document-queryCommandEnabled">queryCommandEnabled</A>(in DOMString commandId);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-querycommandindeterm" title="dom-document-queryCommandIndeterm">queryCommandIndeterm</A>(in DOMString commandId);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-querycommandstate" title="dom-document-queryCommandState">queryCommandState</A>(in DOMString commandId);
  boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-querycommandsupported" title="dom-document-queryCommandSupported">queryCommandSupported</A>(in DOMString commandId);
  DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-querycommandvalue" title="dom-document-queryCommandValue">queryCommandValue</A>(in DOMString commandId);
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-commands" title="dom-document-commands">commands</A>;

  // <A href="http://dev.w3.org/html5/spec/Overview.html#event-handler-idl-attributes">event handler IDL attributes</A>
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onabort" title="handler-onabort">onabort</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onblur" title="handler-onblur">onblur</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncanplay" title="handler-oncanplay">oncanplay</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncanplaythrough" title="handler-oncanplaythrough">oncanplaythrough</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onchange" title="handler-onchange">onchange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onclick" title="handler-onclick">onclick</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncontextmenu" title="handler-oncontextmenu">oncontextmenu</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondblclick" title="handler-ondblclick">ondblclick</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondrag" title="handler-ondrag">ondrag</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragend" title="handler-ondragend">ondragend</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragenter" title="handler-ondragenter">ondragenter</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragleave" title="handler-ondragleave">ondragleave</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragover" title="handler-ondragover">ondragover</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragstart" title="handler-ondragstart">ondragstart</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondrop" title="handler-ondrop">ondrop</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondurationchange" title="handler-ondurationchange">ondurationchange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onemptied" title="handler-onemptied">onemptied</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onended" title="handler-onended">onended</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onerror" title="handler-onerror">onerror</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onfocus" title="handler-onfocus">onfocus</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onformchange" title="handler-onformchange">onformchange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onforminput" title="handler-onforminput">onforminput</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oninput" title="handler-oninput">oninput</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oninvalid" title="handler-oninvalid">oninvalid</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeydown" title="handler-onkeydown">onkeydown</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeypress" title="handler-onkeypress">onkeypress</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeyup" title="handler-onkeyup">onkeyup</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onload" title="handler-onload">onload</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadeddata" title="handler-onloadeddata">onloadeddata</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadedmetadata" title="handler-onloadedmetadata">onloadedmetadata</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadstart" title="handler-onloadstart">onloadstart</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousedown" title="handler-onmousedown">onmousedown</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousemove" title="handler-onmousemove">onmousemove</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseout" title="handler-onmouseout">onmouseout</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseover" title="handler-onmouseover">onmouseover</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseup" title="handler-onmouseup">onmouseup</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousewheel" title="handler-onmousewheel">onmousewheel</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onpause" title="handler-onpause">onpause</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onplay" title="handler-onplay">onplay</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onplaying" title="handler-onplaying">onplaying</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onprogress" title="handler-onprogress">onprogress</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onratechange" title="handler-onratechange">onratechange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onreadystatechange" title="handler-onreadystatechange">onreadystatechange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onscroll" title="handler-onscroll">onscroll</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onseeked" title="handler-onseeked">onseeked</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onseeking" title="handler-onseeking">onseeking</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onselect" title="handler-onselect">onselect</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onshow" title="handler-onshow">onshow</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onstalled" title="handler-onstalled">onstalled</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onsubmit" title="handler-onsubmit">onsubmit</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onsuspend" title="handler-onsuspend">onsuspend</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ontimeupdate" title="handler-ontimeupdate">ontimeupdate</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onvolumechange" title="handler-onvolumechange">onvolumechange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onwaiting" title="handler-onwaiting">onwaiting</A>;
};
<SPAN>Document</SPAN> implements <A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A>;</PRE><P>Since the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> interface holds methods and
  attributes related to a number of disparate features, the members of
  this interface are described in various different sections.</P><H4 id="security"><SPAN class="secno">3.1.2 </SPAN>Security</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>User agents <SPAN class="impl">must</SPAN> raise a
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#security_err">SECURITY_ERR</A></CODE> exception whenever any of the members of
  an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> object are accessed by scripts whose
  <A href="http://dev.w3.org/html5/spec/Overview.html#effective-script-origin">effective script origin</A> is not the <A href="http://dev.w3.org/html5/spec/Overview.html#same-origin" title="same
  origin">same</A> as the <CODE>Document</CODE>'s <A href="http://dev.w3.org/html5/spec/Overview.html#effective-script-origin">effective
  script origin</A>.</P><H4 id="resource-metadata-management"><SPAN class="secno">3.1.3 </SPAN><DFN>Resource metadata management</DFN></H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-URL"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-url">URL</A></CODE></DT>
   <DD>
    <P>Returns <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A>.</P>
   </DD>

   <DT><VAR title="">document</VAR> . <CODE title="dom-document-referrer"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-referrer">referrer</A></CODE></DT>
   <DD>
    <P>Returns <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-current-address" title="the document&#39;s current address">the
    address</A> of the <CODE>Document</CODE> from which the user
    navigated to this one, unless it was blocked or there was no such
    document, in which case it returns the empty string.</P>
    <P>The <CODE title="rel-noreferrer"><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-noreferrer">noreferrer</A></CODE> link
    type can be used to block the referrer.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-document-url" title="dom-document-URL"><CODE>URL</CODE></DFN>
  attribute must return <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A>.</P>

  <P>The <DFN id="dom-document-referrer" title="dom-document-referrer"><CODE>referrer</CODE></DFN> attribute
  must return either the <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-current-address" title="the document&#39;s current
  address">current address</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#active-document">active document</A>
  of the <A href="http://dev.w3.org/html5/spec/Overview.html#source-browsing-context">source browsing context</A> <EM>at the time the
  navigation was started</EM> (that is, the page which <A href="http://dev.w3.org/html5/spec/Overview.html#navigate" title="navigate">navigated</A> the <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A>
  to the current document), with any <A href="http://dev.w3.org/html5/spec/Overview.html#url-fragment" title="url-fragment">&lt;fragment&gt;</A> component removed; or
  the empty string if there is no such originating page, or if the UA
  has been configured not to report referrers in this case, or if the
  navigation was initiated for a <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink">hyperlink</A> with a <CODE title="rel-noreferrer"><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-noreferrer">noreferrer</A></CODE> keyword.</P>

  <P class="note">In the case of HTTP, the <CODE title="dom-document-referrer"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-referrer">referrer</A></CODE> IDL attribute will
  match the <CODE title="http-referer">Referer</CODE> (sic) header
  that was sent when <A href="http://dev.w3.org/html5/spec/Overview.html#fetch" title="fetch">fetching</A> the current
  page.</P>

  <P class="note">Typically user agents are configured to not report
  referrers in the case where the referrer uses an encrypted protocol
  and the current page does not (e.g. when navigating from an <CODE title="">https:</CODE> page to an <CODE title="">http:</CODE>
  page).</P>

  <HR></DIV><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-cookie"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-cookie">cookie</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the HTTP cookies that apply to the
    <CODE>Document</CODE>. If there are no cookies or cookies can't be
    applied to this resource, the empty string will be returned.</P>
    <P>Can be set, to add a new cookie to the element's set of HTTP
    cookies.</P>
    <P>If the <CODE>Document</CODE> has no <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing
    context</A> an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> exception will be
    thrown. If the contents are <A href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" title="sandboxed origin browsing
    context flag">sandboxed into a unique origin</A>, a
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#security_err">SECURITY_ERR</A></CODE> exception will be thrown.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-document-cookie" title="dom-document-cookie"><CODE>cookie</CODE></DFN>
  attribute represents the cookies of the resource.</P>

  <P id="sandboxCookies">On getting, if the document is not associated
  with a <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A> then the user agent must raise
  an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> exception. Otherwise, if the
  <A href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag">sandboxed origin browsing context flag</A> was set on the
  <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A> of the <CODE>Document</CODE> when the
  <CODE>Document</CODE> was created, the user agent must raise a
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#security_err">SECURITY_ERR</A></CODE> exception. Otherwise, if <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the
  document's address</A> does not use a server-based naming
  authority, it must return the empty string. Otherwise, it must first
  <A href="http://dev.w3.org/html5/spec/Overview.html#obtain-the-storage-mutex">obtain the storage mutex</A> and then return the
  cookie-string for <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A> for a
  "non-HTTP" API. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCOOKIES">[COOKIES]</A></P>

  <P>On setting, if the document is not associated with a
  <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A> then the user agent must raise an
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> exception. Otherwise, if the
  <A href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag">sandboxed origin browsing context flag</A> was set on the
  <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A> of the <CODE>Document</CODE> when the
  <CODE>Document</CODE> was created, the user agent must raise a
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#security_err">SECURITY_ERR</A></CODE> exception. Otherwise, if <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the
  document's address</A> does not use a server-based naming
  authority, it must do nothing. Otherwise, the user agent must
  <A href="http://dev.w3.org/html5/spec/Overview.html#obtain-the-storage-mutex">obtain the storage mutex</A> and then act as it would when
  <SPAN title="receives a set-cookie-string">receiving a
  set-cookie-string</SPAN> for <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A> via
  a "non-HTTP" API, consisting of the new value. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCOOKIES">[COOKIES]</A></P>

  <P class="note">Since the <CODE title="dom-document-cookie"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-cookie">cookie</A></CODE> attribute is accessible
  across frames, the path restrictions on cookies are only a tool to
  help manage which cookies are sent to which parts of the site, and
  are not in any way a security feature.</P>

  <HR></DIV><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-lastmodified"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-lastmodified">lastModified</A></CODE></DT>
   <DD>
    <P>Returns the date of the last modification to the document, as
    reported by the server, in the form "<CODE title="">MM/DD/YYYY&nbsp;hh:mm:ss</CODE>".</P>
    <P>If the last modification date is not known, the current time is
    returned instead.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-document-lastmodified" title="dom-document-lastModified"><CODE>lastModified</CODE></DFN>
  attribute, on getting, must return the date and time of the
  <CODE>Document</CODE>'s source file's last modification, in the
  user's local time zone, in the following format:</P>

  <OL><LI> The month component of the date. </LI>

   <LI> A U+002F SOLIDUS character (/). </LI>

   <LI> The day component of the date. </LI>

   <LI> A U+002F SOLIDUS character (/). </LI>

   <LI> The year component of the date. </LI>

   <LI> A U+0020 SPACE character. </LI>

   <LI> The hours component of the time. </LI>

   <LI> A U+003A COLON character (:). </LI>

   <LI> The minutes component of the time. </LI>

   <LI> A U+003A COLON character (:). </LI>

   <LI> The seconds component of the time. </LI>

  </OL><P>All the numeric components above, other than the year, must be
  given as two digits in the range U+0030 DIGIT ZERO (0) to U+0039
  DIGIT NINE (9) representing the number in base ten, zero-padded if
  necessary. The year must be given as the shortest possible string of
  four or more digits in the range U+0030 DIGIT ZERO (0) to U+0039
  DIGIT NINE (9) representing the number in base ten, zero-padded if
  necessary.</P>

  <P>The <CODE>Document</CODE>'s source file's last modification date
  and time must be derived from relevant features of the networking
  protocols used, e.g. from the value of the HTTP <CODE title="http-last-modified">Last-Modified</CODE> header of the
  document, or from metadata in the file system for local files. If
  the last modification date and time are not known, the attribute
  must return the current date and time in the above format.</P>

  <HR></DIV><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-compatmode"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-compatmode">compatMode</A></CODE></DT>
   <DD>
    <P>In a conforming document, returns the string "<CODE title="">CSS1Compat</CODE>". (In <A href="http://dev.w3.org/html5/spec/Overview.html#quirks-mode">quirks mode</A>
    documents, returns the string "<CODE title="">BackCompat</CODE>",
    but a conforming document can never trigger <A href="http://dev.w3.org/html5/spec/Overview.html#quirks-mode">quirks
    mode</A>.)</P>
   </DD>

  </DL><DIV class="impl">

  <P>A <CODE>Document</CODE> is always set to one of three modes:
  <DFN id="no-quirks-mode">no quirks mode</DFN>, the default; <DFN id="quirks-mode">quirks mode</DFN>, used
  typically for legacy documents; and <DFN id="limited-quirks-mode">limited quirks mode</DFN>,
  also known as "almost standards" mode. The mode is only ever changed
  from the default by the <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A>, based on the
  presence, absence, or value of the DOCTYPE string.</P>

  <P>The <DFN id="dom-document-compatmode" title="dom-document-compatMode"><CODE>compatMode</CODE></DFN> IDL
  attribute must return the literal string "<CODE title="">CSS1Compat</CODE>" unless the document has been set to
  <A href="http://dev.w3.org/html5/spec/Overview.html#quirks-mode">quirks mode</A> by the <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A>, in which
  case it must instead return the literal string "<CODE title="">BackCompat</CODE>".</P>

  <HR></DIV><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-charset"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-charset">charset</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's character encoding</A>.</P>
    <P>Can be set, to dynamically change the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's
    character encoding</A>.</P>
    <P>New values that are not IANA-registered aliases supported by the user agent are ignored.</P>
   </DD>

   <DT><VAR title="">document</VAR> . <CODE title="dom-document-characterSet"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-characterset">characterSet</A></CODE></DT>
   <DD>
    <P>Returns the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's character encoding</A>.</P>
   </DD>

   <DT><VAR title="">document</VAR> . <CODE title="dom-document-defaultCharset"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-defaultcharset">defaultCharset</A></CODE></DT>
   <DD>
    <P>Returns what might be the user agent's default character encoding.</P>
   </DD>

  </DL><DIV class="impl">

  <P>Documents have an associated <DFN id="document-s-character-encoding" title="document&#39;s character
  encoding">character encoding</DFN>. When a <CODE>Document</CODE>
  object is created, the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's character encoding</A>
  must be initialized to UTF-16. Various algorithms during page
  loading affect this value, as does the <CODE title="dom-document-charset"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-charset">charset</A></CODE> setter. <A href="http://dev.w3.org/html5/spec/Overview.html#refsIANACHARSET">[IANACHARSET]</A></P>

  <P>The <DFN id="dom-document-charset" title="dom-document-charset"><CODE>charset</CODE></DFN>
  IDL attribute must, on getting, return the <A href="http://dev.w3.org/html5/spec/Overview.html#preferred-mime-name">preferred MIME
  name</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's character encoding</A>. On
  setting, if the new value is an IANA-registered alias for a
  character encoding supported by the user agent, the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's
  character encoding</A> must be set to that character
  encoding. (Otherwise, nothing happens.)</P>

  <P>The <DFN id="dom-document-characterset" title="dom-document-characterSet"><CODE>characterSet</CODE></DFN>
  IDL attribute must, on getting, return the <A href="http://dev.w3.org/html5/spec/Overview.html#preferred-mime-name">preferred MIME
  name</A> of the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's character encoding</A>.</P>

  <P>The <DFN id="dom-document-defaultcharset" title="dom-document-defaultCharset"><CODE>defaultCharset</CODE></DFN>
  IDL attribute must, on getting, return the <A href="http://dev.w3.org/html5/spec/Overview.html#preferred-mime-name">preferred MIME
  name</A> of a character encoding, possibly the user's default
  encoding, or an encoding associated with the user's current
  geographical location, or any arbitrary encoding name.</P>

  <HR></DIV><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-readyState"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-readystate">readyState</A></CODE></DT>
   <DD>
    <P>Returns "loading" while the <CODE>Document</CODE> is loading, and "complete" once it has loaded.</P>
    <P>The <CODE title="event-readystatechange">readystatechange</CODE> event fires on the <CODE>Document</CODE> object when this value changes.</P>
   </DD>

  </DL><DIV class="impl">

  <P>Each document has a <DFN id="current-document-readiness">current document readiness</DFN>. When a
  <CODE>Document</CODE> object is created, it must have its
  <A href="http://dev.w3.org/html5/spec/Overview.html#current-document-readiness">current document readiness</A> set to the string "loading"
  if the document is associated with an <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A> or an
  <A href="http://dev.w3.org/html5/spec/Overview.html#xml-parser">XML parser</A>, or to the string "complete"
  otherwise. Various algorithms during page loading affect this
  value. When the value is set, the user agent must <A href="http://dev.w3.org/html5/spec/Overview.html#fire-a-simple-event">fire a
  simple event</A> named <CODE title="event-readystatechange">readystatechange</CODE> at the
  <CODE>Document</CODE> object.</P>

  <P>A <CODE>Document</CODE> is said to have an <DFN id="active-parser">active
  parser</DFN> if it is associated with an <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A> or
  an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-parser">XML parser</A> that has not yet been <A href="http://dev.w3.org/html5/spec/Overview.html#stop-parsing" title="stop
  parsing">stopped</A> or aborted.</P>

  <P>The <DFN id="dom-document-readystate" title="dom-document-readyState"><CODE>readyState</CODE></DFN> IDL
  attribute must, on getting, return the <A href="http://dev.w3.org/html5/spec/Overview.html#current-document-readiness">current document
  readiness</A>.</P>

  </DIV><H4 id="dom-tree-accessors"><SPAN class="secno">3.1.4 </SPAN><DFN>DOM tree accessors</DFN></H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><DFN id="the-html-element">The <CODE>html</CODE> element</DFN> of a document is the
  document's root element, if there is one and it's an
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element, or null otherwise.</P><HR><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-head"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-head">head</A></CODE></DT>
   <DD>
    <P>Returns <A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element">the <CODE>head</CODE> element</A>.</P>
   </DD>

  </DL><P><DFN id="the-head-element">The <CODE>head</CODE> element</DFN> of a document is the
  first <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element that is a child of <A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element">the
  <CODE>html</CODE> element</A>, if there is one, or null
  otherwise.</P><DIV class="impl">

  <P>The <DFN id="dom-document-head" title="dom-document-head"><CODE>head</CODE></DFN>
  attribute, on getting, must return <A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element">the <CODE>head</CODE>
  element</A> of the document (a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element or
  null).</P>

  </DIV><HR><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-title"><A href="http://dev.w3.org/html5/spec/Overview.html#document.title">title</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns the document's title, as given by <A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element">the
    <CODE>title</CODE> element</A>.</P>
    <P>Can be set, to update the document's title. If there is no
    <A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element" title="the head element"><CODE>head</CODE> element</A>,
    the new value is ignored.</P>
    <P>In SVG documents, the <CODE>SVGDocument</CODE> interface's
    <CODE title="dom-svg-title">title</CODE> attribute takes
    precedence.</P>
   </DD>

  </DL><P><DFN id="the-title-element">The <CODE>title</CODE> element</DFN> of a document is the
  first <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element in the document (in tree order), if
  there is one, or null otherwise.</P><DIV class="impl">

  <P>The <DFN id="document.title" title="dom-document-title"><CODE>title</CODE></DFN> attribute must,
  on getting, run the following algorithm:</P>

  <OL><LI><P>If the <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A> is an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#svg">svg</A></CODE>
   element in the "<CODE title="">http://www.w3.org/2000/svg</CODE>"
   namespace, and the user agent supports SVG, then return the value
   that would have been returned by the IDL attribute of the same name
   on the <CODE>SVGDocument</CODE> interface. <A href="http://dev.w3.org/html5/spec/Overview.html#refsSVG">[SVG]</A></P></LI>

   <LI><P>Otherwise, let <VAR title="">value</VAR> be a concatenation
   of the data of all the child <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text node">text
   nodes</A> of <A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element">the <CODE>title</CODE> element</A>, in
   <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>, or the empty string if <A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element">the
   <CODE>title</CODE> element</A> is null.</P></LI>

   <LI><P>Replace any sequence of one or more consecutive <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A> in <VAR title="">value</VAR> with a single U+0020 SPACE character.</P></LI>

   <LI><P>Remove any leading or trailing <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space
   character">space characters</A> in <VAR title="">value</VAR>.</P></LI>

   <LI><P>Return <VAR title="">value</VAR>.</P></LI>

  </OL><P>On setting, the following algorithm must be run. Mutation events
  must be fired as appropriate.</P>

  <OL><LI><P>If the <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A> is an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#svg">svg</A></CODE>
   element in the "<CODE title="">http://www.w3.org/2000/svg</CODE>"
   namespace, and the user agent supports SVG, then the setter must
   defer to the setter for the IDL attribute of the same name on the
   <CODE>SVGDocument</CODE> interface (if it is readonly, then this
   will raise an exception). Stop the algorithm here. <A href="http://dev.w3.org/html5/spec/Overview.html#refsSVG">[SVG]</A></P></LI>

   <LI>If <A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element">the <CODE>title</CODE> element</A> is null and
   <A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element">the <CODE>head</CODE> element</A> is null, then the
   attribute must do nothing. Stop the algorithm here.</LI>

   <LI>If <A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element">the <CODE>title</CODE> element</A> is null, then a
   new <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element must be created and appended to
   <A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element">the <CODE>head</CODE> element</A>. Let <VAR title="">element</VAR> be that element. Otherwise, let <VAR title="">element</VAR> be <A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element">the <CODE>title</CODE>
   element</A>.</LI>

   <LI>The children of <VAR title="">element</VAR> (if any) must all
   be removed.</LI>

   <LI>A single <CODE>Text</CODE> node whose data is the new value
   being assigned must be appended to <VAR title="">element</VAR>.</LI>

  </OL><P>The <CODE title="dom-document-title"><A href="http://dev.w3.org/html5/spec/Overview.html#document.title">title</A></CODE> attribute on
  the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> interface should shadow the attribute
  of the same name on the <CODE>SVGDocument</CODE> interface when the
  user agent supports both HTML and SVG. <A href="http://dev.w3.org/html5/spec/Overview.html#refsSVG">[SVG]</A></P>

  </DIV><HR><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-body"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-body">body</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns <A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element">the body element</A>.</P>
    <P>Can be set, to replace <A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element">the body element</A>.</P>
    <P>If the new value is not a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> or <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE> element, this will throw a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#hierarchy_request_err">HIERARCHY_REQUEST_ERR</A></CODE> exception.</P>
   </DD>

  </DL><P><DFN id="the-body-element">The body element</DFN> of a document is the first child of
  <A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element">the <CODE>html</CODE> element</A> that is either a
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> element or a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE> element. If
  there is no such element, it is null. <SPAN class="impl">If the body
  element is null, then when the specification requires that events be
  fired at "the body element", they must instead be fired at the
  <CODE>Document</CODE> object.</SPAN></P><DIV class="impl">

  <P>The <DFN id="dom-document-body" title="dom-document-body"><CODE>body</CODE></DFN>
  attribute, on getting, must return <A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element">the body element</A> of
  the document (either a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> element, a
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE> element, or null). On setting, the following
  algorithm must be run:</P>

  <OL><!-- if changes are requested:
    http://lxr.mozilla.org/seamonkey/source/content/html/document/src/nsHTMLDocument.cpp
    search for ::GetBody ::SetBody
    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLDocument.cpp
    search for ::setBody
    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/dom/Document.cpp
    search for ::body
   --><LI>If the new value is not a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> or
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#frameset">frameset</A></CODE> element, then raise a
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#hierarchy_request_err">HIERARCHY_REQUEST_ERR</A></CODE> exception and abort these
   steps.</LI>

   <LI>Otherwise, if the new value is the same as <A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element">the body
   element</A>, do nothing. Abort these steps.</LI>

   <LI>Otherwise, if <A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element">the body element</A> is not null, then
   replace that element with the new value in the DOM, as if the root
   element's <CODE title="">replaceChild()</CODE> method had been
   called with the new value and <A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element" title="the body element">the
   incumbent body element</A> as its two arguments respectively,
   then abort these steps.</LI>

   <LI>Otherwise, <A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element">the body element</A> is null. Append
   the new value to the root element.</LI>

  </OL></DIV><HR><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-images"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-images">images</A></CODE></DT>
   <DD>
    <P>Returns an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> elements in the <CODE>Document</CODE>.</P>
   </DD>

   <DT><VAR title="">document</VAR> . <CODE title="dom-document-embeds"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-embeds">embeds</A></CODE></DT>
   <DT><VAR title="">document</VAR> . <CODE title="dom-document-plugins"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-plugins">plugins</A></CODE></DT>
   <DD>
    <P>Return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE> elements in the <CODE>Document</CODE>.</P>
   </DD>

   <DT><VAR title="">document</VAR> . <CODE title="dom-document-links"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-links">links</A></CODE></DT>
   <DD>
    <P>Returns an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE> elements in the <CODE>Document</CODE> that have <CODE title="attr-hyperlink-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-href">href</A></CODE> attributes.</P>
   </DD>

   <DT><VAR title="">document</VAR> . <CODE title="dom-document-forms"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-forms">forms</A></CODE></DT>
   <DD>
    <P>Return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE> elements in the <CODE>Document</CODE>.</P>
   </DD>

   <DT><VAR title="">document</VAR> . <CODE title="dom-document-scripts"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-scripts">scripts</A></CODE></DT>
   <DD>
    <P>Return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE> elements in the <CODE>Document</CODE>.</P>
   </DD>

  </DL><DIV class="impl">

  <!-- these all return the same object each time because of a rule in
  the collection section -->

  <P>The <DFN id="dom-document-images" title="dom-document-images"><CODE>images</CODE></DFN>
  attribute must return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> rooted at the
  <CODE>Document</CODE> node, whose filter matches only
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> elements.</P>

  <P>The <DFN id="dom-document-embeds" title="dom-document-embeds"><CODE>embeds</CODE></DFN>
  attribute must return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> rooted at the
  <CODE>Document</CODE> node, whose filter matches only
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE> elements.</P>

  <P>The <DFN id="dom-document-plugins" title="dom-document-plugins"><CODE>plugins</CODE></DFN>
  attribute must return the same object as that returned by the <CODE title="dom-document-embeds"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-embeds">embeds</A></CODE> attribute.</P>

  <P>The <DFN id="dom-document-links" title="dom-document-links"><CODE>links</CODE></DFN>
  attribute must return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> rooted at the
  <CODE>Document</CODE> node, whose filter matches only <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>
  elements with <CODE title="attr-hyperlink-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-href">href</A></CODE>
  attributes and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE> elements with <CODE title="attr-hyperlink-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-href">href</A></CODE> attributes.</P>

  <P>The <DFN id="dom-document-forms" title="dom-document-forms"><CODE>forms</CODE></DFN>
  attribute must return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> rooted at the
  <CODE>Document</CODE> node, whose filter matches only
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE> elements.</P>

  <P>The <DFN id="dom-document-scripts" title="dom-document-scripts"><CODE>scripts</CODE></DFN>
  attribute must return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> rooted at the
  <CODE>Document</CODE> node, whose filter matches only
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE> elements.</P>

  <HR></DIV><DL class="domintro"><DT><VAR title="">collection</VAR> = <VAR title="">document</VAR> . <CODE title="dom-document-getElementsByName"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyname">getElementsByName</A></CODE>(<VAR title="">name</VAR>)</DT>
   <DD>
    <P>Returns a <CODE>NodeList</CODE> of elements in the
    <CODE>Document</CODE> that have a <CODE title="">name</CODE>
    attribute with the value <VAR title="">name</VAR>.</P>
   </DD>

   <DT><VAR title="">collection</VAR> = <VAR title="">document</VAR> . <CODE title="dom-document-getElementsByClassName"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyclassname">getElementsByClassName(<VAR title="">classes</VAR>)</A></CODE></DT>
   <DT><VAR title="">collection</VAR> = <VAR title="">element</VAR> . <CODE title="dom-getElementsByClassName"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-getelementsbyclassname">getElementsByClassName(<VAR title="">classes</VAR>)</A></CODE></DT>
   <DD>
    <P>Returns a <CODE>NodeList</CODE> of the elements in the object
    on which the method was invoked (a <CODE>Document</CODE> or an
    <CODE>Element</CODE>) that have all the classes given by <VAR title="">classes</VAR>.</P>
    <P>The <VAR title="">classes</VAR> argument is interpreted as a
    space-separated list of classes.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-document-getelementsbyname" title="dom-document-getElementsByName"><CODE>getElementsByName(<VAR title="">name</VAR>)</CODE></DFN> method takes a string <VAR title="">name</VAR>, and must return a live <CODE>NodeList</CODE>
  containing all the <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> in that document that
  have a <CODE title="">name</CODE> attribute whose value is equal to
  the <VAR title="">name</VAR> argument (in a
  <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A> manner), in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>.</P>

  <P>The <DFN id="dom-document-getelementsbyclassname" title="dom-document-getElementsByClassName"><CODE>getElementsByClassName(<VAR title="">classNames</VAR>)</CODE></DFN> method takes a string that
  contains a <A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens">set of space-separated tokens</A> representing
  classes. When called, the method must return a live
  <CODE>NodeList</CODE> object containing all the elements in the
  document, in <A href="http://dev.w3.org/html5/spec/Overview.html#tree-order">tree order</A>, that have all the classes
  specified in that argument, having obtained the classes by <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a string on spaces">splitting a string on
  spaces</A>. (Duplicates are ignored.) If there are no tokens
  specified in the argument, then the method must return an empty
  <CODE>NodeList</CODE>. If the document is in <A href="http://dev.w3.org/html5/spec/Overview.html#quirks-mode">quirks
  mode</A>, then the comparisons for the classes must be done in an
  <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII case-insensitive</A> manner, otherwise, the
  comparisons must be done in a <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A>
  manner.</P>

  <P>The <DFN id="dom-getelementsbyclassname" title="dom-getElementsByClassName"><CODE>getElementsByClassName(<VAR title="">classNames</VAR>)</CODE></DFN> method on the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A></CODE> interface must return a live
  <CODE>NodeList</CODE> with the nodes that the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> <CODE title="dom-document-getElementsByClassName"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyclassname">getElementsByClassName()</A></CODE>
  method would return when passed the same argument(s), excluding any
  elements that are not descendants of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A></CODE>
  object on which the method was invoked.</P>

  </DIV><P>HTML, SVG, and MathML elements define which classes they are in
  by having an attribute with no namespace with the name <CODE title="">class</CODE> containing a space-separated list of classes
  to which the element belongs. Other specifications may also allow
  elements in their namespaces to be labeled as being in specific
  classes.</P><DIV class="example">

   <P>Given the following XHTML fragment:</P>

   <PRE>&lt;div id="example"&gt;
 &lt;p id="p1" class="aaa bbb"/&gt;
 &lt;p id="p2" class="aaa ccc"/&gt;
 &lt;p id="p3" class="bbb ccc"/&gt;
&lt;/div&gt;</PRE>

   <P>A call to
   <CODE>document.getElementById('example').getElementsByClassName('aaa')</CODE>
   would return a <CODE>NodeList</CODE> with the two paragraphs
   <CODE>p1</CODE> and <CODE>p2</CODE> in it.</P>

   <P>A call to <CODE>getElementsByClassName('ccc&nbsp;bbb')</CODE>
   would only return one node, however, namely <CODE>p3</CODE>. A call
   to
   <CODE>document.getElementById('example').getElementsByClassName('bbb&nbsp;&nbsp;ccc&nbsp;')</CODE>
   would return the same thing.</P>

   <P>A call to <CODE>getElementsByClassName('aaa,bbb')</CODE> would
   return no nodes; none of the elements above are in the "aaa,bbb"
   class.</P>

  </DIV><!-- v2:
>         * xGetParentElementByClassName(rootElement, className, tagName) -
> Navigates upwards until we hit a parent element with the given class name and
> optional tag name.
--><DIV class="impl">

  <HR><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> interface <SPAN title="support
  named properties">supports named properties</SPAN>. The <SPAN>names
  of the supported named properties</SPAN> at any moment consist of
  the values of the <CODE title="attr-name">name</CODE> content
  attributes of all the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE>,
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE>, and
  <A href="http://dev.w3.org/html5/spec/Overview.html#fallback-free">fallback-free</A> <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> elements in the
  <CODE>Document</CODE> that have <CODE title="attr-name">name</CODE>
  content attributes, and the values of the <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> content attributes of all the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE> and <A href="http://dev.w3.org/html5/spec/Overview.html#fallback-free">fallback-free</A>
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> elements in the <CODE>Document</CODE> that have
  <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> content attributes, and the values
  of the <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> content attributes of all the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> elements in the <CODE>Document</CODE> that have
  both <CODE title="attr-name">name</CODE> content attributes and
  <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> content attributes.</P>

  <P>When <DFN id="dom-document-nameditem" title="dom-document-namedItem">the
  <CODE>HTMLDocument</CODE> object is indexed for property
  retrieval</DFN> using a name <VAR title="">name</VAR>, then the user
  agent must return the value obtained using the following steps:</P>

  <OL><LI>

    <P>Let <VAR title="">elements</VAR> be the list of <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-nameditem-filter" title="dom-document-namedItem-filter">named elements</A> with
    the name <VAR title="">name</VAR> in the <CODE>Document</CODE>.

    </P><P class="note">There will be at least one such element, by
    definition.<!-- (If there wasn't, then this algorithm wouldn't
    have been invoked by Web IDL.) --></P>

   </LI>

   <LI>

    <P>If <VAR title="">elements</VAR> has only one element, and that
    element is an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE> element, then return the
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#windowproxy">WindowProxy</A></CODE> object of the <A href="http://dev.w3.org/html5/spec/Overview.html#nested-browsing-context">nested browsing
    context</A> represented by that <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE> element,
    and abort these steps.</P>

   </LI>

   <LI>

    <P>Otherwise, if <VAR title="">elements</VAR> has only one
    element, return that element and abort these steps.</P>

   </LI>

   <LI>

    <P>Otherwise return an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> rooted at the
    <CODE>Document</CODE> node, whose filter matches only <A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-nameditem-filter" title="dom-document-namedItem-filter">named elements</A> with
    the name <VAR title="">name</VAR>.</P> <!-- the same one each time
    is returned, because of the rule under collections -->

   </LI>

  <!--
  Note that this named getter overrides built-in properties, as in:
     http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A...%3Ciframe%20name%3Dbody%3E%3C%2Fiframe%3E%3Cscript%3Ew(document.body)%3C%2Fscript%3E
  This is what the "OverrideBuiltins" bit means in the IDL.
  -->

  </OL><P><DFN id="dom-document-nameditem-filter" title="dom-document-nameditem-filter">Named elements</DFN>
  with the name <VAR title="">name</VAR>, for the purposes of the
  above algorithm, are those that are either:</P>

  <UL><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE>,
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE>, or
   <A href="http://dev.w3.org/html5/spec/Overview.html#fallback-free">fallback-free</A> <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> elements that have a
   <CODE title="attr-name">name</CODE> content attribute whose value
   is <VAR title="">name</VAR>, or</LI>

   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-applet-element">applet</A></CODE> or <A href="http://dev.w3.org/html5/spec/Overview.html#fallback-free">fallback-free</A>
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> elements that have an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> content attribute whose value is <VAR title="">name</VAR>, or</LI>

   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> elements that have an <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> content attribute whose value is <VAR title="">name</VAR>, and that have a <CODE title="attr-name">name</CODE> content attribute present also.</LI>

  </UL><P>An <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> element is said to be
  <DFN id="fallback-free">fallback-free</DFN> if it has no <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> or
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE> descendants.</P>

  </DIV><HR><P class="note">The <CODE title="dom-document-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-dir">dir</A></CODE>
  attribute on the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> interface is defined
  along with the <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> content
  attribute.</P><H4 id="creating-documents"><SPAN class="secno">3.1.5 </SPAN>Creating documents</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A> can be created from script using the
  <CODE title="dom-DOMImplementation-createDocument">createDocument()</CODE>
  method on the <CODE>DOMImplementation</CODE> interface.</P><P><A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A> can be created using the <CODE title="dom-DOMHTMLImplementation-createHTMLDocument"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-domhtmlimplementation-createhtmldocument">createHTMLDocument()</A></CODE>
  method:</P><PRE class="idl">[Supplemental, NoInterfaceObject]
interface <DFN id="domhtmlimplementation">DOMHTMLImplementation</DFN> {
  <SPAN>Document</SPAN> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-domhtmlimplementation-createhtmldocument" title="dom-DOMHTMLImplementation-createHTMLDocument">createHTMLDocument</A>(in DOMString title);
};
<SPAN>DOMImplementation</SPAN> implements <A href="http://dev.w3.org/html5/spec/Overview.html#domhtmlimplementation">DOMHTMLImplementation</A>;</PRE><P>The <DFN id="dom-domhtmlimplementation-createhtmldocument" title="dom-DOMHTMLImplementation-createHTMLDocument"><CODE>createHTMLDocument(<VAR title="">title</VAR>)</CODE></DFN> method, when invoked, must run the
  following steps:</P><OL><LI><P>Let <VAR title="">doc</VAR> be a newly created
   <CODE>Document</CODE> object.</P></LI>

   <LI><P>Mark <VAR title="">doc</VAR> as being an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML
   documents">HTML document</A>.</P></LI>

   <LI><P>Create a <CODE>DocumentType</CODE> node with the <CODE title="">name</CODE> attribute set to the string "<CODE title="">html</CODE>", and the other attributes specific to
   <CODE>DocumentType</CODE> objects set to the empty string, null,
   and empty lists, as appropriate. Append the newly created node to
   <VAR title="">doc</VAR>.</P></LI>

   <LI><P>Create an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element, and append it to <VAR title="">doc</VAR>.</P></LI>

   <LI><P>Create a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element, and append it to the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element created in the previous step.</P>

   </LI><LI><P>Create a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element, and append it to the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element created in the previous step.</P>

   </LI><LI><P>Create a <CODE>Text</CODE> node, and set its <CODE title="">data</CODE> attribute to the string given by the method's
   argument (which could be the empty string). Append it to the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element created in the previous step.</P>

   </LI><LI><P>Create a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> element, and append it to the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element created in the earlier step.</P>

   </LI><LI><P>Return <VAR title="">doc</VAR>.</P></LI>

  </OL><H3 id="elements"><SPAN class="secno">3.2 </SPAN>Elements</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><H4 id="semantics-0"><SPAN class="secno">3.2.1 </SPAN>Semantics</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments. </I><SPAN><A href="http://www.w3.org/html/wg/tracker/issues/41">ISSUE-41</A> (Decentralized-extensibility) blocks progress to Last Call</SPAN></P><P>Elements, attributes, and attribute values in HTML are defined
  (by this specification) to have certain meanings (semantics). For
  example, the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ol-element">ol</A></CODE> element represents an ordered list, and
  the <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE> attribute represents the
  language of the content.</P><P>Authors must not use elements, attributes, or attribute values
  for purposes other than their appropriate intended semantic
  purpose. Authors must not use elements, attributes, or attribute
  values that are not permitted by this specification or <A href="http://dev.w3.org/html5/spec/Overview.html#other-applicable-specifications">other
  applicable specifications</A>.</P><DIV class="example">
   <P>For example, the following document is non-conforming, despite
   being syntactically correct:</P>

   <PRE class="bad">&lt;!DOCTYPE HTML&gt;
&lt;html lang="en-GB"&gt;
 &lt;head&gt; &lt;title&gt; Demonstration &lt;/title&gt; &lt;/head&gt;
 &lt;body&gt;
  &lt;table&gt;
   &lt;tr&gt; &lt;td&gt; My favourite animal is the cat. &lt;/td&gt; &lt;/tr&gt;
   &lt;tr&gt;
    &lt;td&gt;
     —&lt;a href="http://example.org/~ernest/"&gt;&lt;cite&gt;Ernest&lt;/cite&gt;&lt;/a&gt;,
     in an essay from 1992
    &lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
 &lt;/body&gt;
&lt;/html&gt;</PRE>

   <P>...because the data placed in the cells is clearly not tabular
   data (and the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-cite-element">cite</A></CODE> element mis-used). A corrected
   version of this document might be:</P>

   <PRE>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en-GB"&gt;
 &lt;head&gt; &lt;title&gt; Demonstration &lt;/title&gt; &lt;/head&gt;
 &lt;body&gt;
  &lt;blockquote&gt;
   &lt;p&gt; My favourite animal is the cat. &lt;/p&gt;
  &lt;/blockquote&gt;
  &lt;p&gt;
   —&lt;a href="http://example.org/~ernest/"&gt;Ernest&lt;/a&gt;,
   in an essay from 1992
  &lt;/p&gt;
 &lt;/body&gt;
&lt;/html&gt;</PRE>

   <P>This next document fragment, intended to represent the heading
   of a corporate site, is similarly non-conforming because the second
   line is not intended to be a heading of a subsection, but merely a
   subheading or subtitle (a subordinate heading for the same
   section).</P>

   <PRE class="bad">&lt;body&gt;
 &lt;h1&gt;ABC Company&lt;/h1&gt;
 &lt;h2&gt;Leading the way in widget design since 1432&lt;/h2&gt;
 ...</PRE>

   <P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> element is intended for these kinds of
   situations:</P>

   <PRE>&lt;body&gt;
 &lt;hgroup&gt;
  &lt;h1&gt;ABC Company&lt;/h1&gt;
  &lt;h2&gt;Leading the way in widget design since 1432&lt;/h2&gt;
 &lt;/hgroup&gt;
 ...</PRE>

   <P>In the next example, there is a non-conforming attribute value
   ("carpet") and a non-conforming attribute ("texture"), which
   is not permitted by this specification:</P>

   <PRE class="bad">&lt;label&gt;Carpet: &lt;input type="carpet" name="c" texture="deep pile"&gt;&lt;/label&gt;</PRE>

   <P>Here would be an alternative and correct way to mark this up:</P>

   <PRE>&lt;label&gt;Carpet: &lt;input type="text" class="carpet" name="c" data-texture="deep pile"&gt;&lt;/label&gt;</PRE>

  </DIV><P>Through scripting and using other mechanisms, the values of
  attributes, text, and indeed the entire structure of the document
  may change dynamically while a user agent is processing it. The
  semantics of a document at an instant in time are those represented
  by the state of the document at that instant in time, and the
  semantics of a document can therefore change over time. User agents
  <SPAN class="impl">must</SPAN> update their presentation of the
  document as this occurs.</P><P class="example">HTML has a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-progress-element">progress</A></CODE> element that
  describes a progress bar. If its "value" attribute is dynamically
  updated by a script, the UA would update the rendering to show the
  progress changing.</P><H4 id="elements-in-the-dom"><SPAN class="secno">3.2.2 </SPAN>Elements in the DOM</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The nodes representing <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> in the DOM
  <SPAN class="impl">must</SPAN> implement, and expose to scripts, the
  interfaces listed for them in the relevant sections of this
  specification. This includes <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> in <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML
  documents</A>, even when those documents are in another context
  (e.g. inside an XSLT transform).</P><P>Elements in the DOM <A href="http://dev.w3.org/html5/spec/Overview.html#represents" title="represents">represent</A>
  things; that is, they have intrinsic <EM>meaning</EM>, also known as
  semantics.</P><P class="example">For example, an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ol-element">ol</A></CODE> element
  represents an ordered list.</P><P>The basic interface, from which all the <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML
  elements</A>' interfaces inherit, <SPAN class="impl">and which
  must be used by elements that have no additional
  requirements,</SPAN> is the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A></CODE> interface.</P><PRE class="idl">interface <DFN id="htmlelement">HTMLElement</DFN> : <SPAN>Element</SPAN> {
  // <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tree-accessors">DOM tree accessors</A>
  NodeList <A href="http://dev.w3.org/html5/spec/Overview.html#dom-getelementsbyclassname" title="dom-getElementsByClassName">getElementsByClassName</A>(in DOMString classNames);

  // <A href="http://dev.w3.org/html5/spec/Overview.html#dynamic-markup-insertion">dynamic markup insertion</A>
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml" title="dom-innerHTML">innerHTML</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-outerhtml" title="dom-outerHTML">outerHTML</A>;
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-insertadjacenthtml" title="dom-insertAdjacentHTML">insertAdjacentHTML</A>(in DOMString position, in DOMString text);

  // <SPAN>metadata attributes</SPAN>
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-id" title="dom-id">id</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-title" title="dom-title">title</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-lang" title="dom-lang">lang</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-dir" title="dom-dir">dir</A>;
           attribute <SPAN>DOMString</SPAN> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-classname" title="dom-className">className</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#domtokenlist">DOMTokenList</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-classlist" title="dom-classList">classList</A>;
  readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-dataset" title="dom-dataset">dataset</A>;

  // <A href="http://dev.w3.org/html5/spec/Overview.html#editing">user interaction</A>
           attribute boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-hidden" title="dom-hidden">hidden</A>;
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-click" title="dom-click">click</A>();
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-scrollintoview" title="dom-scrollIntoView">scrollIntoView</A>();
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-scrollintoview" title="dom-scrollIntoView">scrollIntoView</A>(in boolean top);
           attribute long <A href="http://dev.w3.org/html5/spec/Overview.html#dom-tabindex" title="dom-tabindex">tabIndex</A>;
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-focus" title="dom-focus">focus</A>();
  void <A href="http://dev.w3.org/html5/spec/Overview.html#dom-blur" title="dom-blur">blur</A>();
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-accesskey" title="dom-accessKey">accessKey</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-accesskeylabel" title="dom-accessKeyLabel">accessKeyLabel</A>;
           attribute boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-draggable" title="dom-draggable">draggable</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-contenteditable" title="dom-contentEditable">contentEditable</A>;
  readonly attribute boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-iscontenteditable" title="dom-isContentEditable">isContentEditable</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#htmlmenuelement">HTMLMenuElement</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-contextmenu" title="dom-contextMenu">contextMenu</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-spellcheck" title="dom-spellcheck">spellcheck</A>;

  // <A href="http://dev.w3.org/html5/spec/Overview.html#command-api">command API</A>
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-command-ro-commandtype" title="dom-command-ro-commandType">commandType</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-command-ro-label" title="dom-command-ro-label">label</A>;
  readonly attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-command-ro-icon" title="dom-command-ro-icon">icon</A>;
  readonly attribute boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-command-ro-disabled" title="dom-command-ro-disabled">disabled</A>;
  readonly attribute boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-command-ro-checked" title="dom-command-ro-checked">checked</A>;<!-- v2COMMAND
  readonly attribute <span>HTMLCollection</span> <span title="dom-command-ro-triggers">triggers</span>;-->

  // <SPAN>styling</SPAN>
  readonly attribute <SPAN>CSSStyleDeclaration</SPAN> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-style" title="dom-style">style</A>;

  // <A href="http://dev.w3.org/html5/spec/Overview.html#event-handler-idl-attributes">event handler IDL attributes</A>
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onabort" title="handler-onabort">onabort</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onblur" title="handler-onblur">onblur</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncanplay" title="handler-oncanplay">oncanplay</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncanplaythrough" title="handler-oncanplaythrough">oncanplaythrough</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onchange" title="handler-onchange">onchange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onclick" title="handler-onclick">onclick</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncontextmenu" title="handler-oncontextmenu">oncontextmenu</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondblclick" title="handler-ondblclick">ondblclick</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondrag" title="handler-ondrag">ondrag</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragend" title="handler-ondragend">ondragend</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragenter" title="handler-ondragenter">ondragenter</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragleave" title="handler-ondragleave">ondragleave</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragover" title="handler-ondragover">ondragover</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragstart" title="handler-ondragstart">ondragstart</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondrop" title="handler-ondrop">ondrop</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondurationchange" title="handler-ondurationchange">ondurationchange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onemptied" title="handler-onemptied">onemptied</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onended" title="handler-onended">onended</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onerror" title="handler-onerror">onerror</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onfocus" title="handler-onfocus">onfocus</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onformchange" title="handler-onformchange">onformchange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onforminput" title="handler-onforminput">onforminput</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oninput" title="handler-oninput">oninput</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-oninvalid" title="handler-oninvalid">oninvalid</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeydown" title="handler-onkeydown">onkeydown</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeypress" title="handler-onkeypress">onkeypress</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeyup" title="handler-onkeyup">onkeyup</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onload" title="handler-onload">onload</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadeddata" title="handler-onloadeddata">onloadeddata</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadedmetadata" title="handler-onloadedmetadata">onloadedmetadata</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadstart" title="handler-onloadstart">onloadstart</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousedown" title="handler-onmousedown">onmousedown</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousemove" title="handler-onmousemove">onmousemove</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseout" title="handler-onmouseout">onmouseout</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseover" title="handler-onmouseover">onmouseover</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseup" title="handler-onmouseup">onmouseup</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousewheel" title="handler-onmousewheel">onmousewheel</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onpause" title="handler-onpause">onpause</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onplay" title="handler-onplay">onplay</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onplaying" title="handler-onplaying">onplaying</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onprogress" title="handler-onprogress">onprogress</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onratechange" title="handler-onratechange">onratechange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onreadystatechange" title="handler-onreadystatechange">onreadystatechange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onscroll" title="handler-onscroll">onscroll</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onseeked" title="handler-onseeked">onseeked</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onseeking" title="handler-onseeking">onseeking</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onselect" title="handler-onselect">onselect</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onshow" title="handler-onshow">onshow</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onstalled" title="handler-onstalled">onstalled</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onsubmit" title="handler-onsubmit">onsubmit</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onsuspend" title="handler-onsuspend">onsuspend</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-ontimeupdate" title="handler-ontimeupdate">ontimeupdate</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onvolumechange" title="handler-onvolumechange">onvolumechange</A>;
           attribute <A href="http://dev.w3.org/html5/spec/Overview.html#function">Function</A> <A href="http://dev.w3.org/html5/spec/Overview.html#handler-onwaiting" title="handler-onwaiting">onwaiting</A>;
};

interface <DFN id="htmlunknownelement">HTMLUnknownElement</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> { };</PRE><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A></CODE> interface holds methods and
  attributes related to a number of disparate features, and the
  members of this interface are therefore described in various
  different sections of this specification.</P><DIV class="impl">

  <P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlunknownelement">HTMLUnknownElement</A></CODE> interface must be used for
  <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> that are not defined by this
  specification (or <A href="http://dev.w3.org/html5/spec/Overview.html#other-applicable-specifications">other applicable specifications</A>).</P>

  </DIV><H4 id="global-attributes"><SPAN class="secno">3.2.3 </SPAN><DFN>Global attributes</DFN></H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The following attributes are common to and may be specified on
  all <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A><SPAN class="impl"> (even those not
  defined in this specification)</SPAN>:</P><UL class="brief"><LI><CODE title="attr-accesskey"><A href="http://dev.w3.org/html5/spec/Overview.html#the-accesskey-attribute">accesskey</A></CODE></LI>
   <LI><CODE title="attr-class"><A href="http://dev.w3.org/html5/spec/Overview.html#classes">class</A></CODE></LI>
   <LI><CODE title="attr-contenteditable"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-contenteditable">contenteditable</A></CODE></LI>
   <LI><CODE title="attr-contextmenu"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-contextmenu">contextmenu</A></CODE></LI>
   <LI><CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE></LI>
   <LI><CODE title="attr-draggable"><A href="http://dev.w3.org/html5/spec/Overview.html#the-draggable-attribute">draggable</A></CODE></LI>
   <LI><CODE title="attr-hidden"><A href="http://dev.w3.org/html5/spec/Overview.html#the-hidden-attribute">hidden</A></CODE></LI>
   <LI><CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE></LI>
   <LI><CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE></LI>
   <LI><CODE title="attr-spellcheck"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-spellcheck">spellcheck</A></CODE></LI>
   <LI><CODE title="attr-style"><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute">style</A></CODE></LI>
   <LI><CODE title="attr-tabindex"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-tabindex">tabindex</A></CODE></LI>
   <LI><CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE></LI>
  </UL><HR><P>The following <A href="http://dev.w3.org/html5/spec/Overview.html#event-handler-content-attributes">event handler content attributes</A> may
  be specified on any <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML
  element</A>:</P><UL class="brief"><LI><CODE title="handler-onabort"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onabort">onabort</A></CODE></LI>
   <LI><CODE title="handler-onblur"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onblur">onblur</A></CODE>*</LI>
   <LI><CODE title="handler-oncanplay"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncanplay">oncanplay</A></CODE></LI>
   <LI><CODE title="handler-oncanplaythrough"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncanplaythrough">oncanplaythrough</A></CODE></LI>
   <LI><CODE title="handler-onchange"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onchange">onchange</A></CODE></LI>
   <LI><CODE title="handler-onclick"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onclick">onclick</A></CODE></LI>
   <LI><CODE title="handler-oncontextmenu"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-oncontextmenu">oncontextmenu</A></CODE></LI>
   <LI><CODE title="handler-ondblclick"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondblclick">ondblclick</A></CODE></LI>
   <LI><CODE title="handler-ondrag"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondrag">ondrag</A></CODE></LI>
   <LI><CODE title="handler-ondragend"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragend">ondragend</A></CODE></LI>
   <LI><CODE title="handler-ondragenter"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragenter">ondragenter</A></CODE></LI>
   <LI><CODE title="handler-ondragleave"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragleave">ondragleave</A></CODE></LI>
   <LI><CODE title="handler-ondragover"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragover">ondragover</A></CODE></LI>
   <LI><CODE title="handler-ondragstart"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondragstart">ondragstart</A></CODE></LI>
   <LI><CODE title="handler-ondrop"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondrop">ondrop</A></CODE></LI>
   <LI><CODE title="handler-ondurationchange"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ondurationchange">ondurationchange</A></CODE></LI>
   <LI><CODE title="handler-onemptied"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onemptied">onemptied</A></CODE></LI>
   <LI><CODE title="handler-onended"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onended">onended</A></CODE></LI>
   <LI><CODE title="handler-onerror"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onerror">onerror</A></CODE>*</LI>
   <LI><CODE title="handler-onfocus"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onfocus">onfocus</A></CODE>*</LI>
   <LI><CODE title="handler-onformchange"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onformchange">onformchange</A></CODE></LI>
   <LI><CODE title="handler-onforminput"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onforminput">onforminput</A></CODE></LI>
   <LI><CODE title="handler-oninput"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-oninput">oninput</A></CODE></LI>
   <LI><CODE title="handler-oninvalid"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-oninvalid">oninvalid</A></CODE></LI>
   <LI><CODE title="handler-onkeydown"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeydown">onkeydown</A></CODE></LI>
   <LI><CODE title="handler-onkeypress"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeypress">onkeypress</A></CODE></LI>
   <LI><CODE title="handler-onkeyup"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onkeyup">onkeyup</A></CODE></LI>
   <LI><CODE title="handler-onload"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onload">onload</A></CODE>*</LI>
   <LI><CODE title="handler-onloadeddata"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadeddata">onloadeddata</A></CODE></LI>
   <LI><CODE title="handler-onloadedmetadata"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadedmetadata">onloadedmetadata</A></CODE></LI>
   <LI><CODE title="handler-onloadstart"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onloadstart">onloadstart</A></CODE></LI>
   <LI><CODE title="handler-onmousedown"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousedown">onmousedown</A></CODE></LI>
   <LI><CODE title="handler-onmousemove"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousemove">onmousemove</A></CODE></LI>
   <LI><CODE title="handler-onmouseout"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseout">onmouseout</A></CODE></LI>
   <LI><CODE title="handler-onmouseover"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseover">onmouseover</A></CODE></LI>
   <LI><CODE title="handler-onmouseup"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmouseup">onmouseup</A></CODE></LI>
   <LI><CODE title="handler-onmousewheel"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onmousewheel">onmousewheel</A></CODE></LI>
   <LI><CODE title="handler-onpause"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onpause">onpause</A></CODE></LI>
   <LI><CODE title="handler-onplay"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onplay">onplay</A></CODE></LI>
   <LI><CODE title="handler-onplaying"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onplaying">onplaying</A></CODE></LI>
   <LI><CODE title="handler-onprogress"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onprogress">onprogress</A></CODE></LI>
   <LI><CODE title="handler-onratechange"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onratechange">onratechange</A></CODE></LI>
   <LI><CODE title="handler-onreadystatechange"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onreadystatechange">onreadystatechange</A></CODE></LI>
   <LI><CODE title="handler-onscroll"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onscroll">onscroll</A></CODE></LI>
   <LI><CODE title="handler-onseeked"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onseeked">onseeked</A></CODE></LI>
   <LI><CODE title="handler-onseeking"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onseeking">onseeking</A></CODE></LI>
   <LI><CODE title="handler-onselect"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onselect">onselect</A></CODE></LI>
   <LI><CODE title="handler-onshow"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onshow">onshow</A></CODE></LI>
   <LI><CODE title="handler-onstalled"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onstalled">onstalled</A></CODE></LI>
   <LI><CODE title="handler-onsubmit"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onsubmit">onsubmit</A></CODE></LI>
   <LI><CODE title="handler-onsuspend"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onsuspend">onsuspend</A></CODE></LI>
   <LI><CODE title="handler-ontimeupdate"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-ontimeupdate">ontimeupdate</A></CODE></LI>
   <LI><CODE title="handler-onvolumechange"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onvolumechange">onvolumechange</A></CODE></LI>
   <LI><CODE title="handler-onwaiting"><A href="http://dev.w3.org/html5/spec/Overview.html#handler-onwaiting">onwaiting</A></CODE></LI>
  </UL><P class="note">The attributes marked with an asterisk have a
  different meaning when specified on <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> elements as
  those elements expose <A href="http://dev.w3.org/html5/spec/Overview.html#event-handlers">event handlers</A> of the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#window">Window</A></CODE> object with the same names.</P><P class="note">While these attributes apply to all elements, they
  are not useful on all elements. For example, only <A href="http://dev.w3.org/html5/spec/Overview.html#media-element" title="media
  element">media elements</A> will ever receive a <CODE title="event-media-volumechange"><A href="http://dev.w3.org/html5/spec/Overview.html#event-media-volumechange">volumechange</A></CODE> event fired by
  the user agent.</P><HR><P><A href="http://dev.w3.org/html5/spec/Overview.html#custom-data-attribute" title="custom data attribute">Custom data attributes</A>
  (e.g. <CODE title="">data-foldername</CODE> or <CODE title="">data-msgid</CODE>) can be specified on any <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML element</A>, to store custom data
  specific to the page.</P><HR><P>In <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A>, elements in the <A href="http://dev.w3.org/html5/spec/Overview.html#html-namespace-0">HTML
  namespace</A> may have an <CODE title="">xmlns</CODE> attribute
  specified, if, and only if, it has the exact value
  "<CODE>http://www.w3.org/1999/xhtml</CODE>". This does not apply to
  <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>.</P><P class="note">In HTML, the <CODE title="">xmlns</CODE> attribute
  has absolutely no effect. It is basically a talisman. It is allowed
  merely to make migration to and from XHTML mildly easier. When
  parsed by an <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A>, the attribute ends up in no
  namespace, not the "<CODE>http://www.w3.org/2000/xmlns/</CODE>"
  namespace like namespace declaration attributes in XML do.</P><P class="note">In XML, an <CODE title="">xmlns</CODE> attribute is
  part of the namespace declaration mechanism, and an element cannot
  actually have an <CODE title="">xmlns</CODE> attribute in no
  namespace specified.</P><HR><P>To enable assistive technology products to expose a more
  fine-grained interface than is otherwise possible with HTML elements
  and attributes, a set of <A href="http://dev.w3.org/html5/spec/Overview.html#annotations-for-assistive-technology-products-aria">annotations for assistive technology
  products</A> can be specified.</P><H5 id="the-id-attribute"><SPAN class="secno">3.2.3.1 </SPAN>The <DFN title="attr-id"><CODE>id</CODE></DFN> attribute</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute specifies its
  element's <DFN id="concept-id" title="concept-id">unique identifier (ID)</DFN>. The
  value must be unique amongst all the IDs in the element's <A href="http://dev.w3.org/html5/spec/Overview.html#home-subtree">home
  subtree</A> and must contain at least one character. The value
  must not contain any <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space
  characters</A>.</P><!-- space characters are disallowed because space-separated lists
  of IDs otherwise would not be able to reach all valid IDs --><P class="note">An element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-id" title="concept-id">unique
  identifier</A> can be used for a variety of purposes, most
  notably as a way to link to specific parts of a document using
  fragment identifiers, as a way to target an element when scripting,
  and as a way to style a specific element from CSS.</P><DIV class="impl">

  <P>If the value is not the empty string, user agents must associate
  the element with the given value (exactly, including any space
  characters) for the purposes of ID matching within the element's
  <A href="http://dev.w3.org/html5/spec/Overview.html#home-subtree">home subtree</A> (e.g. for selectors in CSS or for the
  <CODE>getElementById()</CODE> method in the DOM).</P>

  <P>Identifiers are opaque strings. Particular meanings should not be
  derived from the value of the <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE>
  attribute.</P>

  <P>This specification doesn't preclude an element having multiple
  IDs, if other mechanisms (e.g. DOM Core methods) can set an
  element's ID in a way that doesn't conflict with the <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> attribute.</P>

  <P>The <DFN id="dom-id" title="dom-id"><CODE>id</CODE></DFN> IDL attribute must
  <A href="http://dev.w3.org/html5/spec/Overview.html#reflect">reflect</A> the <CODE title="attr-id"><A href="http://dev.w3.org/html5/spec/Overview.html#the-id-attribute">id</A></CODE> content
  attribute.</P>

  </DIV><H5 id="the-title-attribute"><SPAN class="secno">3.2.3.2 </SPAN>The <DFN title="attr-title"><CODE>title</CODE></DFN> attribute</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE> attribute
  <A href="http://dev.w3.org/html5/spec/Overview.html#represents">represents</A> advisory information for the element, such
  as would be appropriate for a tooltip. On a link, this could be the
  title or a description of the target resource; on an image, it could
  be the image credit or a description of the image; on a paragraph,
  it could be a footnote or commentary on the text; on a citation, it
  could be further information about the source; and so forth. The
  value is text.</P><P>If this attribute is omitted from an element, then it implies
  that the <CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE> attribute of the
  nearest ancestor <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML element</A>
  with a <CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE> attribute set is also
  relevant to this element. Setting the attribute overrides this,
  explicitly stating that the advisory information of any ancestors is
  not relevant to this element. Setting the attribute to the empty
  string indicates that the element has no advisory information.</P><P>If the <CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE> attribute's value
  contains U+000A LINE FEED (LF) characters, the content is split into
  multiple lines. Each U+000A LINE FEED (LF) character represents a
  line break.</P><DIV class="example">

   <P>Caution is advised with respect to the use of newlines in <CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE> attributes.</P>

   <P>For instance, the following snippet actually defines an
   abbreviation's expansion <EM>with a line break in it</EM>:</P>

   <PRE class="bad">&lt;p&gt;My logs show that there was some interest in &lt;abbr title="Hypertext
Transport Protocol"&gt;HTTP&lt;/abbr&gt; today.&lt;/p&gt;</PRE>

  </DIV><P>Some elements, such as <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-abbr-element">abbr</A></CODE>, and
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE>, define additional semantics for the <CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE> attribute beyond the semantics
  described above.</P><DIV class="impl">

  <HR><P>The <DFN id="dom-title" title="dom-title"><CODE>title</CODE></DFN> IDL attribute
  must <A href="http://dev.w3.org/html5/spec/Overview.html#reflect">reflect</A> the <CODE title="attr-title"><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-attribute">title</A></CODE>
  content attribute.</P>

  </DIV><H5 id="the-lang-and-xml:lang-attributes"><SPAN class="secno">3.2.3.3 </SPAN>The <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE> and <CODE title="attr-xml-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang">xml:lang</A></CODE> attributes</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <DFN id="attr-lang" title="attr-lang"><CODE>lang</CODE></DFN> attribute (in
  no namespace) specifies the primary language for the element's
  contents and for any of the element's attributes that contain
  text. Its value must be a valid BCP 47 language code, or the empty
  string. Setting the attribute to the empty string indicates that the
  primary language is unknown<!-- UA conformance requirements for this
  are below -->. <A href="http://dev.w3.org/html5/spec/Overview.html#refsBCP47">[BCP47]</A></P><P>The <DFN id="attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE></DFN>
  attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#xml-namespace">XML namespace</A> is defined in XML. <A href="http://dev.w3.org/html5/spec/Overview.html#refsXML">[XML]</A></P><P>If these attributes are omitted from an element, then the
  language of this element is the same as the language of its parent
  element, if any.</P><P>The <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE> attribute in no namespace
  may be used on any <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML
  element</A>.</P><P>The <A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE>
  attribute in the <SPAN>XML namespace</SPAN></A> may be used on
  <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> in <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>, as well as
  elements in other namespaces if the relevant specifications allow it
  (in particular, MathML and SVG allow <A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE> attributes in the
  <SPAN>XML namespace</SPAN></A> to be specified on their
  elements). If both the <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE> attribute
  in no namespace and the <A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE> attribute in the <SPAN>XML
  namespace</SPAN></A> are specified on the same element, they must
  have exactly the same value when compared in an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
  case-insensitive</A> manner.</P><P>Authors must not use the <A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE> attribute in the <SPAN>XML
  namespace</SPAN></A> on <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> in <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML
  documents</A>. To ease migration to and from XHTML, authors may
  specify an attribute in no namespace with no prefix and with the
  literal localname "<CODE title="">xml:lang</CODE>" on <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML
  elements</A> in <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A>, but such attributes
  must only be specified if a <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE>
  attribute in no namespace is also specified, and both attributes
  must have the same value when compared in an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
  case-insensitive</A> manner.</P><P class="note">The attribute in no namespace with no prefix and
  with the literal localname "<CODE title="">xml:lang</CODE>" has no
  effect on language processing.</P><DIV class="impl">

  <HR><P>To determine the <DFN id="language">language</DFN> of a node, user agents must
  look at the nearest ancestor element (including the element itself
  if the node is an element) that has a <A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE> attribute in the
  <SPAN>XML namespace</SPAN></A> set or is an <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML
  elements">HTML element</A> and has a <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE> in no namespace attribute set. That
  attribute specifies the language of the node.</P>

  <P>If both the <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE> attribute in no
  namespace and the <A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE> attribute in the <SPAN>XML
  namespace</SPAN></A> are set on an element, user agents must use
  the <A href="http://dev.w3.org/html5/spec/Overview.html#attr-xml-lang" title="attr-xml-lang"><CODE title="">lang</CODE> attribute
  in the <SPAN>XML namespace</SPAN></A>, and the <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE> attribute in no namespace must be
  <A href="http://dev.w3.org/html5/spec/Overview.html#ignore" title="ignore">ignored</A> for the purposes of determining
  the element's language.</P>

  <P>If no explicit language is given for any ancestors of the node,
  including the <A href="http://dev.w3.org/html5/spec/Overview.html#root-element">root element</A>, but there is a
  <A href="http://dev.w3.org/html5/spec/Overview.html#document-wide-default-language">document-wide default language</A> set, then that is the
  language of the node.</P>

  <P>If there is no <A href="http://dev.w3.org/html5/spec/Overview.html#document-wide-default-language">document-wide default language</A>, then
  language information from a higher-level protocol (such as HTTP), if
  any, must be used as the final fallback language. In the absence of
  any language information, and in cases where the higher-level
  protocol reports multiple languages, the language of the node is
  unknown (the empty string).</P>

  <P>If the resulting value is not a recognized language code, then it
  must be treated as an unknown language having the given language
  code, distinct from all other languages. For the purposes of
  round-tripping or communicating with other services that expect
  language codes, user agents should pass unknown language codes
  through unmodified.</P>

  <P class="example">Thus, for instance, an element with <CODE title="">lang="xyzzy"</CODE> would be matched by the selector <CODE title="">:lang(xyzzy)</CODE> (e.g. in CSS), but it would not be
  matched by <CODE title="">:lang(abcde)</CODE>, even though both are
  equally invalid. Similarly, if a Web browser and screen reader
  working in unison communicated about the language of the element,
  the browser would tell the screen reader that the language was
  "xyzzy", even if it knew it was invalid, just in case the screen
  reader actually supported a language with that code after all.</P>

  <HR><P>User agents may use the element's language to determine proper
  processing or rendering (e.g. in the selection of appropriate
  fonts or pronunciations, or for dictionary selection). <!--User
  agents must not use the element's language to determine text
  directionality. (commented out because text directionality is a
  rendering-level concern.)--></P>

  <HR><P>The <DFN id="dom-lang" title="dom-lang"><CODE>lang</CODE></DFN> IDL attribute
  must <A href="http://dev.w3.org/html5/spec/Overview.html#reflect">reflect</A> the <CODE title="attr-lang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-lang">lang</A></CODE>
  content attribute in no namespace.</P>

  </DIV><H5 id="the-xml:base-attribute-xml-only"><SPAN class="secno">3.2.3.4 </SPAN>The <DFN title="attr-xml-base"><CODE>xml:base</CODE></DFN>
  attribute (XML only)</H5><P>The <CODE title="attr-xml-base"><A href="http://dev.w3.org/html5/spec/Overview.html#the-xml:base-attribute-xml-only">xml:base</A></CODE> attribute is
  defined in XML Base. <A href="http://dev.w3.org/html5/spec/Overview.html#refsXMLBASE">[XMLBASE]</A></P><P>The <CODE title="attr-xml-base"><A href="http://dev.w3.org/html5/spec/Overview.html#the-xml:base-attribute-xml-only">xml:base</A></CODE> attribute may be
  used on elements of <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>. Authors must not
  use the <CODE title="attr-xml-base"><A href="http://dev.w3.org/html5/spec/Overview.html#the-xml:base-attribute-xml-only">xml:base</A></CODE> attribute in
  <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A>.</P><H5 id="the-dir-attribute"><SPAN class="secno">3.2.3.5 </SPAN>The <DFN title="attr-dir"><CODE>dir</CODE></DFN> attribute</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> attribute specifies the
  element's text directionality. The attribute is an <A href="http://dev.w3.org/html5/spec/Overview.html#enumerated-attribute">enumerated
  attribute</A> with the keyword <CODE title="">ltr</CODE> mapping
  to the state <I>ltr</I>, and the keyword <CODE title="">rtl</CODE>
  mapping to the state <I>rtl</I>. The attribute has no
  defaults.</P><DIV class="impl">

  <P>The processing of this attribute is primarily performed by the
  presentation layer. For example, the rendering section in this
  specification defines a mapping from this attribute to the CSS
  'direction' and 'unicode-bidi' properties, and CSS defines rendering
  in terms of those properties.</P>

  </DIV><P><DFN id="the-directionality">The directionality</DFN> of an element, which is used in
  particular by the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element">canvas</A></CODE> element's text rendering API,
  is either 'ltr' or 'rtl'. If the user agent supports CSS and the
  'direction' property on this element has a computed value of either
  'ltr' or 'rtl', then that is <A href="http://dev.w3.org/html5/spec/Overview.html#the-directionality">the directionality</A> of the
  element. Otherwise, if the element is <A href="http://dev.w3.org/html5/spec/Overview.html#being-rendered">being rendered</A>,
  then <A href="http://dev.w3.org/html5/spec/Overview.html#the-directionality">the directionality</A> of the element is the
  directionality used by the presentation layer, potentially
  determined from the value of the <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE>
  attribute on the element. Otherwise, if the element's <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> attribute has the state <I>ltr</I>, the
  element's directionality is 'ltr' (left-to-right); if the attribute
  has the state <I>rtl</I>, the element's directionality is 'rtl'
  (right-to-left); and otherwise, the element's directionality is the
  same as its parent element, or 'ltr' if there is no parent
  element.</P><HR><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-dir">dir</A></CODE> [ = <VAR title="">value</VAR> ]</DT>
   <DD>
    <P>Returns <A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element">the <CODE>html</CODE> element</A>'s <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> attribute's value, if any.</P>
    <P>Can be set, to either "<CODE title="">ltr</CODE>" or "<CODE title="">rtl</CODE>", to replace <A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element">the <CODE>html</CODE> element</A>'s <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> attribute's value.</P>
    <P>If there is no <A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element" title="the html element"><CODE>html</CODE> element</A>, returns the empty string and ignores new values.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-dir" title="dom-dir"><CODE>dir</CODE></DFN> IDL attribute on
  an element must <A href="http://dev.w3.org/html5/spec/Overview.html#reflect">reflect</A> the <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> content attribute of that element,
  <A href="http://dev.w3.org/html5/spec/Overview.html#limited-to-only-known-values">limited to only known values</A>.</P>

  <P>The <DFN id="dom-document-dir" title="dom-document-dir"><CODE>dir</CODE></DFN> IDL
  attribute on <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> objects must
  <A href="http://dev.w3.org/html5/spec/Overview.html#reflect">reflect</A> the <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> content
  attribute of <A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element">the <CODE>html</CODE> element</A>, if any,
  <A href="http://dev.w3.org/html5/spec/Overview.html#limited-to-only-known-values">limited to only known values</A>. If there is no such
  element, then the attribute must return the empty string and do
  nothing on setting.</P>

  </DIV><P class="note">Authors are strongly encouraged to use the <CODE title="attr-dir"><A href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute">dir</A></CODE> attribute to indicate text direction
  rather than using CSS, since that way their documents will continue
  to render correctly even in the absence of CSS (e.g. as interpreted
  by search engines).</P><H5 id="classes"><SPAN class="secno">3.2.3.6 </SPAN>The <DFN title="attr-class"><CODE>class</CODE></DFN> attribute</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Every <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML element</A> may have a
  <CODE title="attr-class"><A href="http://dev.w3.org/html5/spec/Overview.html#classes">class</A></CODE> attribute specified.</P><P>The attribute, if specified, must have a value that is a
  <A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens">set of space-separated tokens</A> representing the various
  classes that the element belongs to.</P><DIV class="impl">

  <P>The classes that an <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML
  element</A> has assigned to it consists of all the classes
  returned when the value of the <CODE title="attr-class"><A href="http://dev.w3.org/html5/spec/Overview.html#classes">class</A></CODE>
  attribute is <A href="http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces" title="split a string on spaces">split on
  spaces</A>. (Duplicates are ignored.)</P>

  </DIV><P class="note">Assigning classes to an element affects class
  matching in selectors in CSS, the <CODE title="dom-document-getElementsByClassName"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyclassname">getElementsByClassName()</A></CODE>
  method in the DOM, and other such features.</P><P>There are no additional restrictions on the tokens authors can
  use in the <CODE title="attr-class"><A href="http://dev.w3.org/html5/spec/Overview.html#classes">class</A></CODE> attribute, but
  authors are encouraged to use values that describe the nature of the
  content, rather than values that describe the desired presentation
  of the content.</P><DIV class="impl">

  <HR><P>The <DFN id="dom-classname" title="dom-className"><CODE>className</CODE></DFN> and
  <DFN id="dom-classlist" title="dom-classList"><CODE>classList</CODE></DFN> IDL
  attributes must both <A href="http://dev.w3.org/html5/spec/Overview.html#reflect">reflect</A> the <CODE title="attr-class"><A href="http://dev.w3.org/html5/spec/Overview.html#classes">class</A></CODE> content attribute.</P>

  </DIV><H5 id="the-style-attribute"><SPAN class="secno">3.2.3.7 </SPAN>The <DFN title="attr-style"><CODE>style</CODE></DFN> attribute</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>All <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> may have the <CODE title="attr-style"><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute">style</A></CODE> content attribute set. This is a
  <SPAN>CSS styling attribute</SPAN> as defined by the CSS Styling
  Attribute Syntax specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCSSATTR">[CSSATTR]</A></P><DIV class="impl">

  <P>In user agents that support CSS, the attribute's value must be
  parsed when the attribute is added or has its value changed<!-- so
  dynamic changes to the base URL don't affect the CSS -->, according
  to the rules given for <SPAN>CSS styling attributes</SPAN>. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCSSATTR">[CSSATTR]</A></P>

  </DIV><P>Documents that use <CODE title="attr-style"><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute">style</A></CODE>
  attributes on any of their elements must still be comprehensible and
  usable if those attributes were removed.</P><P class="note">In particular, using the <CODE title="attr-style"><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute">style</A></CODE> attribute to hide and show content,
  or to convey meaning that is otherwise not included in the document,
  is non-conforming. (To hide and show content, use the <CODE title="attr-hidden"><A href="http://dev.w3.org/html5/spec/Overview.html#the-hidden-attribute">hidden</A></CODE> attribute.)</P><HR><DL class="domintro"><DT><VAR title="">element</VAR> . <CODE title="dom-style"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-style">style</A></CODE></DT>
   <DD>
    <P>Returns a <CODE>CSSStyleDeclaration</CODE> object for the element's <CODE title="attr-style"><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute">style</A></CODE> attribute.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-style" title="dom-style"><CODE>style</CODE></DFN> IDL attribute
  must return a <CODE>CSSStyleDeclaration</CODE> whose value
  represents the declarations specified in the attribute, if
  present. Mutating the <CODE>CSSStyleDeclaration</CODE> object must
  create a <CODE title="attr-font-style">style</CODE> attribute on the
  element (if there isn't one already) and then change its value to be
  a value representing the serialized form of the
  <CODE>CSSStyleDeclaration</CODE> object. <A href="http://dev.w3.org/html5/spec/Overview.html#refsCSSOM">[CSSOM]</A>

  </P></DIV><DIV class="example">

   <P>In the following example, the words that refer to colors are
   marked up using the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-span-element">span</A></CODE> element and the <CODE title="attr-style"><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-attribute">style</A></CODE> attribute to make those words show
   up in the relevant colors in visual media.</P>

   <PRE>&lt;p&gt;My sweat suit is &lt;span style="color: green; background:
transparent"&gt;green&lt;/span&gt; and my eyes are &lt;span style="color: blue;
background: transparent"&gt;blue&lt;/span&gt;.&lt;/p&gt;</PRE>

  </DIV><H5 id="embedding-custom-non-visible-data"><SPAN class="secno">3.2.3.8 </SPAN><DFN>Embedding custom non-visible data</DFN></H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>A <DFN id="custom-data-attribute">custom data attribute</DFN> is an attribute in no
  namespace whose name starts with the string "<DFN id="attr-data" title="attr-data-*"><CODE>data-</CODE></DFN>", has at least one
  character after the hyphen, is <A href="http://dev.w3.org/html5/spec/Overview.html#xml-compatible">XML-compatible</A>, and
  contains no characters in the range U+0041 to U+005A (LATIN CAPITAL
  LETTER A to LATIN CAPITAL LETTER Z).</P><P class="note">All attributes on <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> in
  <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A> get ASCII-lowercased automatically, so
  the restriction on ASCII uppercase letters doesn't affect such
  documents.</P><P><A href="http://dev.w3.org/html5/spec/Overview.html#custom-data-attribute" title="custom data attribute">Custom data attributes</A>
  are intended to store custom data private to the page or
  application, for which there are no more appropriate attributes or
  elements.</P><P>These attributes are not intended for use by software that is
  independent of the site that uses the attributes.</P><DIV class="example">

   <P>For instance, a site about music could annotate list items
   representing tracks in an album with custom data attributes
   containing the length of each track. This information could then be
   used by the site itself to allow the user to sort the list by track
   length, or to filter the list for tracks of certain lengths.</P>

   <PRE>&lt;ol&gt;
 &lt;li data-length="2m11s"&gt;Beyond The Sea&lt;/li&gt;
 ...
&lt;/ol&gt;</PRE>

   <P>It would be inappropriate, however, for the user to use generic
   software not associated with that music site to search for tracks
   of a certain length by looking at this data.</P>

   <P>This is because these attributes are intended for use by the
   site's own scripts, and are not a generic extension mechanism for
   publicly-usable metadata.</P>

  </DIV><P>Every <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML element</A> may have
  any number of <A href="http://dev.w3.org/html5/spec/Overview.html#custom-data-attribute" title="custom data attribute">custom data
  attributes</A> specified, with any value.</P><HR><DL class="domintro"><DT><VAR title="">element</VAR> . <CODE title="dom-dataset"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-dataset">dataset</A></CODE></DT>
   <DD>
    <P>Returns a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> object for the element's <CODE title="attr-data-*"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-data">data-*</A></CODE> attributes.</P>
   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-dataset" title="dom-dataset"><CODE>dataset</CODE></DFN> IDL
  attribute provides convenient accessors for all the <CODE title="attr-data-*"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-data">data-*</A></CODE> attributes on an element. On
  getting, the <CODE title="dom-dataset"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-dataset">dataset</A></CODE> IDL attribute
  must return a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#domstringmap">DOMStringMap</A></CODE> object, associated with the
  following algorithms, which expose these attributes on their
  element:</P>

  <DL><DT>The algorithm for getting the list of name-value pairs</DT>

   <DD>
    <OL><LI>Let <VAR title="">list</VAR> be an empty list of name-value
     pairs.</LI>

     <LI>For each content attribute on the element whose first five
     characters are the string "<CODE title="">data-</CODE>", add a
     name-value pair to <VAR title="">list</VAR> whose name is the
     attribute's name with the first five character removed and whose
     value is the attribute's value.</LI>

     <LI>Return <VAR title="">list</VAR>.</LI>

    </OL></DD>

   <DT>The algorithm for setting names to certain values</DT>

   <DD>
    <OL><LI>Let <VAR title="">name</VAR> be the concatenation of the
     string <CODE title="">data-</CODE> and the name passed to the
     algorithm.</LI>

     <LI>Let <VAR title="">value</VAR> be the value passed to the
     algorithm.</LI>

     <LI>Set the value of the attribute with the name <VAR title="">name</VAR>, to the value <VAR title="">value</VAR>,
     replacing any previous value if the attribute already existed. If
     <CODE title="">setAttribute()</CODE> would have raised an
     exception when setting an attribute with the name <VAR title="">name</VAR>, then this must raise the same
     exception.</LI>

    </OL></DD>

   <DT>The algorithm for deleting names</DT>

   <DD>
    <OL><LI>Let <VAR title="">name</VAR> be the concatenation of the
     string <CODE title="">data-</CODE> and the name passed to the
     algorithm.</LI>

     <LI>Remove the attribute with the name <VAR title="">name</VAR>,
     if such an attribute exists. Do nothing otherwise.</LI>

    </OL></DD>

  </DL></DIV><DIV class="example">

   <P>If a Web page wanted an element to represent a space ship,
   e.g. as part of a game, it would have to use the <CODE class="attr-class">class</CODE> attribute along with <CODE title="attr-data-*"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-data">data-*</A></CODE> attributes:</P>

   <PRE>&lt;div class="spaceship" data-id="92432"
     data-weapons="laser 2" data-shields="50%"
     data-x="30" data-y="10" data-z="90"&gt;
 &lt;button class="fire"
         onclick="spaceships[this.parentNode.dataset.id].fire()"&gt;
  Fire
 &lt;/button&gt;
&lt;/div&gt;</PRE>

  </DIV><P>Authors should carefully design such extensions so that when the
  attributes are ignored and any associated CSS dropped, the page is
  still usable.</P><DIV class="impl">

  <P>User agents must not derive any implementation behavior from
  these attributes or values. Specifications intended for user agents
  must not define these attributes to have any meaningful values.</P>

  </DIV><P>JavaScript libraries may use the <SPAN>custom data
  attributes</SPAN>, as they are considered to be part of the page on
  which they are used. Authors of libraries that are reused by many
  authors are encouraged to include their name in the attribute names,
  to reduce the risk of clashes.</P><DIV class="example">

   <P>For example, a library called "DoQuery" could use attribute
   names like <CODE title="">data-doquery-range</CODE>, and a library
   called "jJo" could use attributes names like <CODE title="">data-jjo-range</CODE>.</P>

  </DIV><H4 id="element-definitions"><SPAN class="secno">3.2.4 </SPAN>Element definitions</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Each element in this specification has a definition that includes
  the following information:</P><DL><DT>Categories</DT>

   <DD>A list of <A href="http://dev.w3.org/html5/spec/Overview.html#content-categories" title="content categories">categories</A> to
   which the element belongs. These are used when defining the
   <A href="http://dev.w3.org/html5/spec/Overview.html#content-models">content models</A> for each element.</DD>


   <DT>Contexts in which this element may be used</DT>

   <DD>A <EM>non-normative</EM> description of where the element can
   be used. This information is redundant with the content models of
   elements that allow this one as a child, and is provided only as a
   convenience.</DD>


   <DT>Content model</DT>

   <DD>A normative description of what content must be included as
   children and descendants of the element.</DD>


   <DT>Content attributes</DT>

   <DD>A normative list of attributes that may be specified on the
   element.</DD>


   <DT>DOM interface</DT>

   <DD>A normative definition of a DOM interface that such elements
   must implement.</DD>

  </DL><P>This is then followed by a description of what the element
  <A href="http://dev.w3.org/html5/spec/Overview.html#represents">represents</A>, along with any additional normative
  conformance criteria that may apply to authors<SPAN class="impl" title=""> and implementations</SPAN>. Examples are sometimes
  also included.</P><H4 id="content-models"><SPAN class="secno">3.2.5 </SPAN><DFN>Content models</DFN></H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Each element defined in this specification has a content model: a
  description of the element's expected contents. An <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML
  elements">HTML element</A> must have contents that match the
  requirements described in the element's content model.</P><P class="note">As noted in the conformance and terminology
  sections, for the purposes of determining if an element matches its
  content model or not, <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text
  node"><CODE>CDATASection</CODE> nodes in the DOM are treated as
  equivalent to <CODE>Text</CODE> nodes</A>, and <A href="http://dev.w3.org/html5/spec/Overview.html#entity-references">entity reference nodes are treated as if
  they were expanded in place</A>.</P><P>The <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space character">space characters</A> are
  always allowed between elements. User agents represent these
  characters between elements in the source markup as text nodes in
  the DOM.<!-- not a conf criteria since the parser now requires this
  --> Empty <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text node">text nodes</A> and <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text node">text nodes</A> consisting of just sequences of
  those characters are considered <DFN id="inter-element-whitespace">inter-element
  whitespace</DFN>.</P><P><A href="http://dev.w3.org/html5/spec/Overview.html#inter-element-whitespace">Inter-element whitespace</A>, comment nodes, and
  processing instruction nodes must be ignored when establishing
  whether an element's contents match the element's content model or
  not, and must be ignored when following algorithms that define
  document and element semantics.</P><P>An element <VAR title="">A</VAR> is said to be <DFN id="preceded-or-followed">preceded or
  followed</DFN> by a second element <VAR title="">B</VAR> if <VAR title="">A</VAR> and <VAR title="">B</VAR> have the same parent node
  and there are no other element nodes or text nodes (other than
  <A href="http://dev.w3.org/html5/spec/Overview.html#inter-element-whitespace">inter-element whitespace</A>) between them.</P><P>Authors must not use <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> anywhere except
  where they are explicitly allowed, as defined for each element, or
  as explicitly required by other specifications. For XML compound
  documents, these contexts could be inside elements from other
  namespaces, if those elements are defined as providing the relevant
  contexts.</P><DIV class="example">
   <P>The Atom specification defines the Atom <CODE title="">content</CODE> element, when its <CODE title="">type</CODE> attribute has the value <CODE title="">xhtml</CODE>, as requiring that it contains a single HTML
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</A></CODE> element. Thus, a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</A></CODE> element is
   allowed in that context, even though this is not explicitly
   normatively stated by this specification. <A href="http://dev.w3.org/html5/spec/Overview.html#refsATOM">[ATOM]</A></P>
  </DIV><P>In addition, <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> may be orphan nodes
  (i.e. without a parent node).</P><DIV class="example">

   <P>For example, creating a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-td-element">td</A></CODE> element and storing it
   in a global variable in a script is conforming, even though
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-td-element">td</A></CODE> elements are otherwise only supposed to be used
   inside <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-tr-element">tr</A></CODE> elements.</P>

   <PRE>var data = {
  name: "Banana",
  cell: document.createElement('td'),
};</PRE>

  </DIV><H5 id="kinds-of-content"><SPAN class="secno">3.2.5.1 </SPAN>Kinds of content</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Each element in HTML falls into zero or more <DFN id="content-categories" title="content
  categories">categories</DFN> that group elements with similar
  characteristics together. The following broad categories are used in
  this specification:</P><UL class="brief"><LI><A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">Metadata content</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#flow-content">Flow content</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#sectioning-content">Sectioning content</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#heading-content">Heading content</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">Phrasing content</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content">Embedded content</A></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#interactive-content">Interactive content</A></LI>
  </UL><P class="note">Some elements also fall into other categories, which
  are defined in other parts of this specification.</P><P>These categories are related as follows:</P><P><OBJECT data="http://dev.w3.org/html5/spec/images/content-venn.svg" height="288" width="512"><IMG alt="Sectioning content, heading content, phrasing content, and
  embedded content are all types of flow content. Embedded content is
  also a type of phrasing content." src="./HTML5_files/content-venn.png"></OBJECT></P><P>In addition, certain elements are categorized as <A href="http://dev.w3.org/html5/spec/Overview.html#form-associated-element" title="form-associated element">form-associated elements</A> and
  further subcategorized to define their role in various form-related
  processing models.</P><P>Some elements have unique requirements and do not fit into any
  particular category.</P><H6 id="metadata-content-0"><SPAN class="secno">3.2.5.1.1 </SPAN>Metadata content</H6><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><DFN id="metadata-content">Metadata content</DFN> is content that sets up the
  presentation or behavior of the rest of the content, or that sets
  up the relationship of the document with other documents, or that
  conveys other "out of band" information.</P><UL class="brief category-list"><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-command">command</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#meta">meta</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-noscript-element">noscript</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-element">style</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE></LI>
  </UL><P>Elements from other namespaces whose semantics are primarily
  metadata-related (e.g. RDF) are also <A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">metadata
  content</A>.</P><DIV class="example">

   <P>Thus, in the XML serialization, one can use RDF, like this:</P>

   <PRE>&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
 &lt;head&gt;
  &lt;title&gt;Hedral's Home Page&lt;/title&gt;
  &lt;r:RDF&gt;
   &lt;Person xmlns="http://www.w3.org/2000/10/swap/pim/contact#"
           r:about="http://hedral.example.com/#"&gt;
    &lt;fullName&gt;Cat Hedral&lt;/fullName&gt;
    &lt;mailbox r:resource="mailto:hedral@damowmow.com"/&gt;
    &lt;personalTitle&gt;Sir&lt;/personalTitle&gt;
   &lt;/Person&gt;
  &lt;/r:RDF&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;h1&gt;My home page&lt;/h1&gt;
  &lt;p&gt;I like playing with string, I guess. Sister says squirrels are fun
  too so sometimes I follow her to play with them.&lt;/p&gt;
 &lt;/body&gt;
&lt;/html&gt;</PRE>

   <P>This isn't possible in the HTML serialization, however.</P>

  </DIV><H6 id="flow-content-0"><SPAN class="secno">3.2.5.1.2 </SPAN>Flow content</H6><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Most elements that are used in the body of documents and
  applications are categorized as <DFN id="flow-content">flow content</DFN>.</P><UL class="brief category-list"><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-abbr-element">abbr</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-address-element">address</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE> (if it is a descendant of a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element">map</A></CODE> element)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-article-element">article</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-aside-element">aside</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#audio">audio</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-b-element">b</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-bdo-element">bdo</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-blockquote-element">blockquote</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-br-element">br</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-button-element">button</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element">canvas</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-cite-element">cite</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-code-element">code</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-command">command</A></CODE></LI>
<!-- v2DATAGRID   <li><code>datagrid</code></li> -->
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-datalist-element">datalist</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-details-element">details</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-dfn-element">dfn</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-dl-element">dl</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-em-element">em</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-fieldset-element">fieldset</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-figure-element">figure</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-footer-element">footer</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element">form</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h1</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h2</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h3</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h4</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h5</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h6</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-header-element">header</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hr-element">hr</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-i-element">i</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-kbd-element">kbd</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-keygen-element">keygen</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-label-element">label</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element">map</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-mark-element">mark</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#math">math</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-meter-element">meter</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-nav-element">nav</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-noscript-element">noscript</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ol-element">ol</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-output-element">output</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-pre-element">pre</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-progress-element">progress</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-q-element">q</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ruby-element">ruby</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-samp-element">samp</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-section-element">section</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-small-element">small</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-span-element">span</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-strong-element">strong</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-style-element">style</A></CODE> (if the <CODE title="attr-style-scoped"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-style-scoped">scoped</A></CODE> attribute is present)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-sub-and-sup-elements">sub</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-sub-and-sup-elements">sup</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#svg">svg</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-table-element">table</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-textarea-element">textarea</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-time-element">time</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ul-element">ul</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-var-element">var</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#video">video</A></CODE></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-content" title="text content">Text</A></LI>
  </UL><P>As a general rule, elements whose content model allows any
  <A href="http://dev.w3.org/html5/spec/Overview.html#flow-content">flow content</A> should have either at least one descendant
  <A href="http://dev.w3.org/html5/spec/Overview.html#text-node">text node</A> that is not <A href="http://dev.w3.org/html5/spec/Overview.html#inter-element-whitespace">inter-element
  whitespace</A>, or at least one descendant element node that is
  <A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content">embedded content</A>. For the purposes of this requirement,
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE> elements and their descendants must not be counted
  as contributing to the ancestors of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE>
  element.</P><P>This requirement is not a hard requirement, however, as there are
  many cases where an element can be empty legitimately, for example
  when it is used as a placeholder which will later be filled in by a
  script, or when the element is part of a template and would on most
  pages be filled in but on some pages is not relevant.</P><H6 id="sectioning-content-0"><SPAN class="secno">3.2.5.1.3 </SPAN>Sectioning content</H6><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><DFN id="sectioning-content">Sectioning content</DFN> is content that defines the scope
  of <A href="http://dev.w3.org/html5/spec/Overview.html#heading-content" title="heading content">headings</A> and <A href="http://dev.w3.org/html5/spec/Overview.html#the-footer-element" title="footer">footers</A>.</P><UL class="brief category-list"><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-article-element">article</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-aside-element">aside</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-nav-element">nav</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-section-element">section</A></CODE></LI>
  </UL><P>Each <A href="http://dev.w3.org/html5/spec/Overview.html#sectioning-content">sectioning content</A> element potentially has a
  heading and an <A href="http://dev.w3.org/html5/spec/Overview.html#outline">outline</A>. See the section on
  <A href="http://dev.w3.org/html5/spec/Overview.html#headings-and-sections">headings and sections</A> for further details.</P><P class="note">There are also certain elements that are <A href="http://dev.w3.org/html5/spec/Overview.html#sectioning-root" title="sectioning root">sectioning roots</A>. These are distinct
  from <A href="http://dev.w3.org/html5/spec/Overview.html#sectioning-content">sectioning content</A>, but they can also have an
  <A href="http://dev.w3.org/html5/spec/Overview.html#outline">outline</A>.</P><H6 id="heading-content-0"><SPAN class="secno">3.2.5.1.4 </SPAN>Heading content</H6><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><DFN id="heading-content">Heading content</DFN> defines the header of a section
  (whether explicitly marked up using <A href="http://dev.w3.org/html5/spec/Overview.html#sectioning-content">sectioning content</A>
  elements, or implied by the heading content itself).</P><UL class="brief category-list"><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h1</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h2</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h3</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h4</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h5</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h6</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE></LI>
  </UL><H6 id="phrasing-content-0"><SPAN class="secno">3.2.5.1.5 </SPAN>Phrasing content</H6><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><DFN id="phrasing-content">Phrasing content</DFN> is the text of the document, as well
  as elements that mark up that text at the intra-paragraph
  level. Runs of <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A> form <A href="http://dev.w3.org/html5/spec/Overview.html#paragraph" title="paragraph">paragraphs</A>.</P><UL class="brief category-list"><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> (if it contains only <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A>)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-abbr-element">abbr</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE> (if it is a descendant of a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element">map</A></CODE> element)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#audio">audio</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-b-element">b</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-bdo-element">bdo</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-br-element">br</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-button-element">button</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element">canvas</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-cite-element">cite</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-code-element">code</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-command">command</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-datalist-element">datalist</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE> (if it contains only <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A>)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-dfn-element">dfn</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-em-element">em</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-i-element">i</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE> (if it contains only <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A>)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-kbd-element">kbd</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-keygen-element">keygen</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-label-element">label</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element">map</A></CODE> (if it contains only <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A>)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-mark-element">mark</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#math">math</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-meter-element">meter</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-noscript-element">noscript</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-output-element">output</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-progress-element">progress</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-q-element">q</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ruby-element">ruby</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-samp-element">samp</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-small-element">small</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-span-element">span</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-strong-element">strong</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-sub-and-sup-elements">sub</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-sub-and-sup-elements">sup</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#svg">svg</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-textarea-element">textarea</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-time-element">time</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-var-element">var</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#video">video</A></CODE></LI>
   <LI><A href="http://dev.w3.org/html5/spec/Overview.html#text-content" title="text content">Text</A></LI>
  </UL><P>As a general rule, elements whose content model allows any
  <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A> should have either at least one
  descendant <A href="http://dev.w3.org/html5/spec/Overview.html#text-node">text node</A> that is not <A href="http://dev.w3.org/html5/spec/Overview.html#inter-element-whitespace">inter-element
  whitespace</A>, or at least one descendant element node that is
  <A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content">embedded content</A>. For the purposes of this requirement,
  nodes that are descendants of <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE> elements must not be
  counted as contributing to the ancestors of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE>
  element.</P><P class="note">Most elements that are categorized as phrasing
  content can only contain elements that are themselves categorized as
  phrasing content, not any flow content.</P><P><DFN id="text-content" title="text content">Text</DFN>, in the context of content
  models, means <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text node">text nodes</A>. <A href="http://dev.w3.org/html5/spec/Overview.html#text-content" title="text content">Text</A> is sometimes used as a content
  model on its own, but is also <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A>, and can
  be <A href="http://dev.w3.org/html5/spec/Overview.html#inter-element-whitespace">inter-element whitespace</A> (if the <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text
  node">text nodes</A> are empty or contain just <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space
  character">space characters</A>).</P><H6 id="embedded-content-0"><SPAN class="secno">3.2.5.1.6 </SPAN>Embedded content</H6><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P><DFN id="embedded-content">Embedded content</DFN> is content that imports another
  resource into the document, or content from another vocabulary that
  is inserted into the document.</P><UL class="brief category-list"><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#audio">audio</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element">canvas</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#math">math</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#svg">svg</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#video">video</A></CODE></LI>
  </UL><P>Elements that are from namespaces other than the <A href="http://dev.w3.org/html5/spec/Overview.html#html-namespace-0">HTML
  namespace</A> and that convey content but not metadata, are
  <A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content">embedded content</A> for the purposes of the content models
  defined in this specification. (For example, MathML, or SVG.)</P><P>Some embedded content elements can have <DFN id="fallback-content">fallback
  content</DFN>: content that is to be used when the external resource
  cannot be used (e.g. because it is of an unsupported format). The
  element definitions state what the fallback is, if any.</P><H6 id="interactive-content-0"><SPAN class="secno">3.2.5.1.7 </SPAN>Interactive content</H6><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><!--
TESTS:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cp%20tabindex%3D1%3Etest%20%3Ca%20href%3D%22%22%3E%20%3Cem%3Etest%3C/em%3E%20%3C/a%3E%0A%3Cscript%3E%0A%20function%20test%20%28e%29%20%7B%20w%28e.type%20+%20%27%20on%20%27%20+%20e.target.tagName%20+%20%27%20through%20%27%20+%20e.currentTarget.tagName%29%3B%20%7D%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%3C/script%3E%0A
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Ca%20href%3Dhttp%3A//google.com/%20target%3Da%3EA%3C/a%3E%3Ca%20href%3Dhttp%3A//yahoo.com/%20target%3Db%3EB%3C/a%3E%3Cbr%3E%0A%3Ciframe%20name%3Da%3E%3C/iframe%3E%3Ciframe%20name%3Db%3E%3C/iframe%3E%0A%3Cscript%3E%0A%20var%20a%20%3D%20document.getElementsByTagName%28%27a%27%29%5B0%5D%3B%0A%20var%20b%20%3D%20document.getElementsByTagName%28%27a%27%29%5B1%5D%3B%0A%20a.appendChild%28b%29%3B%0A%3C/script%3E
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%20onsubmit%3D%22w%28%27onsubmit%27%29%22%3E%3Cem%3EA%3C/em%3E%3C/form%3E%0A%3Cscript%3E%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.attachEvent%28%27onsubmit%27%2C%20function%20%28%29%20%7B%20w%28%27submit%20fired%27%29%20%7D%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.fireEvent%28%27onsubmit%27%29%3B%0A%3C/script%3E
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%3EX%3C/form%3E%0A%3Cscript%3E%0Avar%20evt%20%3D%20document.createEvent%28%22Events%22%29%3B%0Aevt.initEvent%28%22submit%22%2C%20true%2C%20true%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.dispatchEvent%28evt%29%3B%0A%3C/script%3E
--><P><DFN id="interactive-content">Interactive content</DFN> is content that is specifically
  intended for user interaction.</P><UL class="brief category-list"><LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#audio">audio</A></CODE> (if the <CODE title="attr-media-controls"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-media-controls">controls</A></CODE> attribute is present)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-button-element">button</A></CODE></LI>
<!-- v2DATAGRID   <li><code>datagrid</code></li> -->
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-details-element">details</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-embed-element">embed</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-iframe-element">iframe</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> (if the <CODE title="attr-hyperlink-usemap"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-usemap">usemap</A></CODE> attribute is present)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> (if the <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute is <EM>not</EM> in the <A href="http://dev.w3.org/html5/spec/Overview.html#hidden-state" title="attr-input-type-hidden">Hidden</A> state)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-keygen-element">keygen</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-label-element">label</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE> (if the <CODE title="attr-menu-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-menu-type">type</A></CODE> attribute is in the <A href="http://dev.w3.org/html5/spec/Overview.html#toolbar-state" title="toolbar state">toolbar</A> state)</LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> (if the <CODE title="attr-hyperlink-usemap"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-usemap">usemap</A></CODE> attribute is present)<!-- see also comment in <object> section --></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-textarea-element">textarea</A></CODE></LI>
   <LI><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#video">video</A></CODE> (if the <CODE title="attr-media-controls"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-media-controls">controls</A></CODE> attribute is present)</LI>
  </UL><P>Certain elements in HTML have an <A href="http://dev.w3.org/html5/spec/Overview.html#activation-behavior">activation
  behavior</A>, which means that the user can activate them. This
  triggers a sequence of events dependent on the activation mechanism,
  and normally culminating in a <CODE title="event-click">click</CODE>
  event followed by a <CODE title="event-DOMActivate">DOMActivate</CODE> event<SPAN class="impl">, as described below</SPAN>.</P><DIV class="impl">

  <P>The user agent should allow the user to manually trigger elements
  that have an <A href="http://dev.w3.org/html5/spec/Overview.html#activation-behavior">activation behavior</A>, for instance using
  keyboard or voice input, or through mouse clicks. When the user
  triggers an element with a defined <A href="http://dev.w3.org/html5/spec/Overview.html#activation-behavior">activation behavior</A>
  in a manner other than clicking it, the default action of the
  interaction event must be to <A href="http://dev.w3.org/html5/spec/Overview.html#run-synthetic-click-activation-steps">run synthetic click activation
  steps</A> on the element.</P> <!-- interaction event spec point -->

  <P>When a user agent is to <DFN id="run-synthetic-click-activation-steps">run synthetic click activation
  steps</DFN> on an element, the user agent must <A href="http://dev.w3.org/html5/spec/Overview.html#run-pre-click-activation-steps">run pre-click
  activation steps</A> on the element, then <A href="http://dev.w3.org/html5/spec/Overview.html#fire-a-click-event">fire a <CODE title="event-click">click</CODE> event</A> at the element. The
  default action of this <SPAN title="event-click">click</SPAN> event
  must be to <A href="http://dev.w3.org/html5/spec/Overview.html#run-post-click-activation-steps">run post-click activation steps</A> on the
  element. If the event is canceled, the user agent must <A href="http://dev.w3.org/html5/spec/Overview.html#run-canceled-activation-steps">run
  canceled activation steps</A> on the element instead.</P>

  <P>Given an element <VAR title="">target</VAR>, the <DFN id="nearest-activatable-element">nearest
  activatable element</DFN> is the element returned by the following
  algorithm:</P>

  <OL><LI><P>If <VAR title="">target</VAR> has a defined <A href="http://dev.w3.org/html5/spec/Overview.html#activation-behavior">activation
   behavior</A>, then return <VAR title="">target</VAR> and abort
   these steps.</P></LI>

   <LI><P>If <VAR title="">target</VAR> has a parent element, then set
   <VAR title="">target</VAR> to that parent element and return to the
   first step.</P></LI>

   <LI><P>Otherwise, there is no <A href="http://dev.w3.org/html5/spec/Overview.html#nearest-activatable-element">nearest activatable
   element</A>.</P></LI>

  </OL><P>When a pointing device is clicked, the user agent must run these
  steps:</P>

  <OL><LI><P>Let <VAR title="">e</VAR> be the <SPAN title="">nearest
   activatable element</SPAN> of the element designated by the user,
   if any.</P></LI>

   <LI><P>If there is an element <VAR title="">e</VAR>, <A href="http://dev.w3.org/html5/spec/Overview.html#run-pre-click-activation-steps">run
   pre-click activation steps</A> on it.</P></LI>

   <LI>

    <P>Dispatch the required <CODE title="event-click">click</CODE>
    event.</P> <!-- interaction event spec point -->

    <P>If there is an element <VAR title="">e</VAR>, then the default
    action of the <SPAN title="event-click">click</SPAN> event must be
    to <A href="http://dev.w3.org/html5/spec/Overview.html#run-post-click-activation-steps">run post-click activation steps</A> on element <VAR title="">e</VAR>.</P>

    <P>If there is an element <VAR title="">e</VAR> but the event is
    canceled, the user agent must <A href="http://dev.w3.org/html5/spec/Overview.html#run-canceled-activation-steps">run canceled activation
    steps</A> on element <VAR title="">e</VAR>.</P>

   </LI>

  </OL><P class="note">The above doesn't happen for arbitrary synthetic
  events dispatched by author script. However, the <CODE title="dom-click"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-click">click()</A></CODE> method can be used to make it
  happen programmatically.</P>

  <P>When a user agent is to <DFN id="run-pre-click-activation-steps">run pre-click activation steps</DFN>
  on an element, it must run the <DFN id="pre-click-activation-steps">pre-click activation steps</DFN>
  defined for that element, if any.</P>

  <P>When a user agent is to <DFN id="run-post-click-activation-steps">run post-click activation
  steps</DFN> on an element, the user agent must <A href="http://dev.w3.org/html5/spec/Overview.html#fire-a-simple-event">fire a simple
  event</A> named <CODE title="event-DOMActivate">DOMActivate</CODE> that is cancelable at
  that element. The default action of this event must be to <A href="http://dev.w3.org/html5/spec/Overview.html#run-final-activation-steps">run
  final activation steps</A> on that element. If the event is
  canceled, the user agent must <A href="http://dev.w3.org/html5/spec/Overview.html#run-canceled-activation-steps">run canceled activation
  steps</A> on the element instead.</P>

  <P>When a user agent is to <DFN id="run-canceled-activation-steps">run canceled activation steps</DFN>
  on an element, it must run the <DFN id="canceled-activation-steps">canceled activation steps</DFN>
  defined for that element, if any.</P>

  <P>When a user agent is to <DFN id="run-final-activation-steps">run final activation steps</DFN> on
  an element, it must run the <DFN id="activation-behavior">activation behavior</DFN> defined
  for that element. Activation behaviors can refer to the <CODE title="event-click">click</CODE> and <CODE title="event-DOMActivate">DOMActivate</CODE> events that were fired
  by the steps above leading up to this point.</P>

  </DIV><H5 id="transparent-content-models"><SPAN class="secno">3.2.5.2 </SPAN>Transparent content models</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>Some elements are described as <DFN id="transparent">transparent</DFN>; they have
  "transparent" in the description of their content model.</P><P>When a content model includes a part that is "transparent", those
  parts must not contain content that would not be conformant if all
  transparent elements in the tree were replaced, in their parent
  element, by the children in the "transparent" part of their content
  model, retaining order.</P><DIV class="example">

   <P>Consider the following markup fragment:</P>

   <PRE>&lt;p&gt;Hello &lt;a href="world.html"&gt;&lt;em&gt;wonderful&lt;/em&gt; world&lt;/a&gt;!&lt;/p&gt;</PRE>

   <P>Its DOM looks like the following:</P>

   <UL class="domTree"><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">Hello </SPAN></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> <SPAN class="t2" title=""><CODE class="attribute name">href</CODE>="<CODE class="attribute value">world.html</CODE>"</SPAN><UL><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-em-element">em</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">wonderful</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title=""> world</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title="">!</SPAN></LI></UL></LI></UL><P>The content model of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> element is
   <A href="http://dev.w3.org/html5/spec/Overview.html#transparent">transparent</A>. To see if its contents are conforming,
   therefore, the element is replaced by its contents:</P>

   <UL class="domTree"><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">Hello </SPAN></LI><LI class="t1"><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-em-element">em</A></CODE><UL><LI class="t3"><CODE>#text</CODE>: <SPAN title="">wonderful</SPAN></LI></UL></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title=""> world</SPAN></LI><LI class="t3"><CODE>#text</CODE>: <SPAN title="">!</SPAN></LI></UL></LI></UL><P>Since that is conforming, the contents of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> are
   conforming in the original fragment.</P>

  </DIV><P>When a transparent element has no parent, then the part of its
  content model that is "transparent" must instead be treated as
  accepting any <A href="http://dev.w3.org/html5/spec/Overview.html#flow-content">flow content</A>.</P><H5 id="paragraphs"><SPAN class="secno">3.2.5.3 </SPAN>Paragraphs</H5><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P class="note">The term <A href="http://dev.w3.org/html5/spec/Overview.html#paragraph">paragraph</A> as defined in this
  section is distinct from (though related to) the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE>
  element defined later. The <A href="http://dev.w3.org/html5/spec/Overview.html#paragraph">paragraph</A> concept defined
  here is used to describe how to interpret documents.</P><P>A <DFN id="paragraph">paragraph</DFN> is typically a run of <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing
  content</A> that forms a block of text with one or more sentences
  that discuss a particular topic, as in typography, but can also be
  used for more general thematic grouping. For instance, an address is
  also a paragraph, as is a part of a form, a byline, or a stanza in a
  poem.</P><DIV class="example">

   <P>In the following example, there are two paragraphs in a
   section. There is also a heading, which contains phrasing content
   that is not a paragraph. Note how the comments and
   <A href="http://dev.w3.org/html5/spec/Overview.html#inter-element-whitespace">inter-element whitespace</A> do not form paragraphs.</P>

   <PRE>&lt;section&gt;
  &lt;h1&gt;Example of paragraphs&lt;/h1&gt;
  This is the &lt;em&gt;first&lt;/em&gt; paragraph in this example.
  &lt;p&gt;This is the second.&lt;/p&gt;
  &lt;!-- This is not a paragraph. --&gt;
&lt;/section&gt;</PRE>

  </DIV><P>Paragraphs in <A href="http://dev.w3.org/html5/spec/Overview.html#flow-content">flow content</A> are defined relative to
  what the document looks like without the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>,
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE>, and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element">map</A></CODE> elements
  complicating matters, since those elements, with their hybrid
  content models, can straddle paragraph boundaries, as shown in the
  first two examples below.</P><P class="note">Generally, having elements straddle paragraph
  boundaries is best avoided. Maintaining such markup can be
  difficult.</P><DIV class="example">

   <P>The following example takes the markup from the earlier example
   and puts <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE> and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE> elements around some
   of the markup to show that the text was changed (though in this
   case, the changes admittedly don't make much sense). Notice how
   this example has exactly the same paragraphs as the previous one,
   despite the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE> and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE> elements —
   the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE> element straddles the heading and the first
   paragraph, and the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE> element straddles the boundary
   between the two paragraphs.</P>

   <PRE>&lt;section&gt;
  &lt;ins&gt;&lt;h1&gt;Example of paragraphs&lt;/h1&gt;
  This is the &lt;em&gt;first&lt;/em&gt; paragraph in&lt;/ins&gt; this example&lt;del&gt;.
  &lt;p&gt;This is the second.&lt;/p&gt;&lt;/del&gt;
  &lt;!-- This is not a paragraph. --&gt;
&lt;/section&gt;</PRE>

  </DIV><DIV class="impl">

  <P>Let <VAR title="">view</VAR> be a view of the DOM that replaces
  all <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE>, and
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element">map</A></CODE> elements in the document with their contents. Then,
  in <VAR title="">view</VAR>, for each run of sibling <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing
  content</A> nodes uninterrupted by other types of content, in an
  element that accepts content other than <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing
  content</A> as well as <A href="http://dev.w3.org/html5/spec/Overview.html#phrasing-content">phrasing content</A>, let <VAR title="">first</VAR> be the first node of the run, and let <VAR title="">last</VAR> be the last node of the run. For each such run
  that consists of at least one node that is neither <A href="http://dev.w3.org/html5/spec/Overview.html#embedded-content">embedded
  content</A> nor <A href="http://dev.w3.org/html5/spec/Overview.html#inter-element-whitespace">inter-element whitespace</A>, a
  paragraph exists in the original DOM from immediately before <VAR title="">first</VAR> to immediately after <VAR title="">last</VAR>. (Paragraphs can thus span across
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ins-element">ins</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-del-element">del</A></CODE>, and
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-map-element">map</A></CODE> elements.)</P>

  <P>Conformance checkers may warn authors of cases where they have
  paragraphs that overlap each other (this can happen with
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#video">video</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#audio">audio</A></CODE>, and
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element">canvas</A></CODE> elements, and indirectly through elements in
  other namespaces that allow HTML to be further embedded therein,
  like <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#svg">svg</A></CODE> or <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#math">math</A></CODE>).</P> <!-- example below
  -->

  </DIV><P>A <A href="http://dev.w3.org/html5/spec/Overview.html#paragraph">paragraph</A> is also formed explicitly by
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE> elements.</P><P class="note">The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE> element can be used to wrap
  individual paragraphs when there would otherwise not be any content
  other than phrasing content to separate the paragraphs from each
  other.</P><DIV class="example">

   <P>In the following example, the link spans half of the first
   paragraph, all of the heading separating the two paragraphs, and
   half of the second paragraph. It straddles the paragraphs and the
   heading.</P>

   <PRE>&lt;aside&gt;
 Welcome!
 &lt;a href="about.html"&gt;
  This is home of...
  &lt;h1&gt;The Falcons!&lt;/h1&gt;
  The Lockheed Martin multirole jet fighter aircraft!
 &lt;/a&gt;
 This page discusses the F-16 Fighting Falcon's innermost secrets.
&lt;/aside&gt;</PRE>

   <P>Here is another way of marking this up, this time showing the
   paragraphs explicitly, and splitting the one link element into
   three:</P>

   <PRE>&lt;aside&gt;
 &lt;p&gt;Welcome! &lt;a href="about.html"&gt;This is home of...&lt;/a&gt;&lt;/p&gt;
 &lt;h1&gt;&lt;a href="about.html"&gt;The Falcons!&lt;/a&gt;&lt;/h1&gt;
 &lt;p&gt;&lt;a href="about.html"&gt;The Lockheed Martin multirole jet
 fighter aircraft!&lt;/a&gt; This page discusses the F-16 Fighting
 Falcon's innermost secrets.&lt;/p&gt;
&lt;/aside&gt;</PRE>

  </DIV><DIV class="example">

   <!-- I don't know if there's a better way to deal with this, but if
   there is, let me know... -->

   <P>It is possible for paragraphs to overlap when using certain
   elements that define fallback content. For example, in the
   following section:</P>

   <PRE>&lt;section&gt;
 &lt;h1&gt;My Cats&lt;/h1&gt;
 You can play with my cat simulator.
 &lt;object data="cats.sim"&gt;
  To see the cat simulator, use one of the following links:
  &lt;ul&gt;
   &lt;li&gt;&lt;a href="cats.sim"&gt;Download simulator file&lt;/a&gt;
   &lt;li&gt;&lt;a href="http://sims.example.com/watch?v=LYds5xY4INU"&gt;Use online simulator&lt;/a&gt;
  &lt;/ul&gt;
  Alternatively, upgrade to the Mellblom Browser.
 &lt;/object&gt;
 I'm quite proud of it.
&lt;/section&gt;</PRE>

   <P>There are five paragraphs:</P>

   <OL class="brief"><LI>The paragraph that says "You can play with my cat
    simulator. <I title="">object</I> I'm quite proud of it.", where
    <I title="">object</I> is the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-object-element">object</A></CODE> element.</LI>

    <LI>The paragraph that says "To see the cat simulator, use one of
    the following links:".</LI>

    <LI>The paragraph that says "Download simulator file".</LI>

    <LI>The paragraph that says "Use online simulator".</LI>

    <LI>The paragraph that says "Alternatively, upgrade to the Mellblom Browser.".</LI>

   </OL><P>The first paragraph is overlapped by the other four. A user
   agent that supports the "cats.sim" resource will only show the
   first one, but a user agent that shows the fallback will
   confusingly show the first sentence of the first paragraph as
   if it was in the same paragraph as the second one, and will show
   the last paragraph as if it was at the start of the second sentence
   of the first paragraph.</P>

   <P>To avoid this confusion, explicit <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-p-element">p</A></CODE> elements can be
   used.</P>

  </DIV><H4 id="annotations-for-assistive-technology-products-aria"><SPAN class="secno">3.2.6 </SPAN><DFN>Annotations for assistive technology products</DFN> (ARIA)</H4><P>Authors may use the ARIA <CODE title="attr-aria-role">role</CODE>
  and <CODE title="attr-aria-*">aria-*</CODE> attributes on <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML
  elements</A>, in accordance with the requirements described in
  the ARIA specifications, except where these conflict with the
  <SPAN>strong native semantics</SPAN> described below. These
  exceptions are intended to prevent authors from making assistive
  technology products report nonsensical states that do not represent
  the actual state of the document. <A href="http://dev.w3.org/html5/spec/Overview.html#refsARIA">[ARIA]</A></P><DIV class="impl">

  <P>User agents are required to implement ARIA semantics on all
  <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A>, as defined in the ARIA
  specifications. The <SPAN>implicit ARIA semantics</SPAN> defined
  below must be recognised by implementations. <A href="http://dev.w3.org/html5/spec/Overview.html#refsARIAIMPL">[ARIAIMPL]</A></P>

  </DIV><P>The following table defines the <SPAN>strong native
  semantics</SPAN> <SPAN class="impl">and corresponding <SPAN>implicit
  ARIA semantics</SPAN></SPAN> that apply to <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML
  elements</A>. Each language feature (element or attribute) in a
  cell in the first column implies the ARIA semantics (role, states,
  and/or properties) given in the cell in the second column of the
  same row. Authors must not set the ARIA <CODE title="attr-aria-role">role</CODE> and <CODE title="attr-aria-*">aria-*</CODE> attributes in a manner that
  conflicts with the semantics described in the following table. <SPAN class="impl">When multiple rows apply to an element, the role from
  the last row to define a role must be applied, and the states and
  properties from all the rows must be combined.</SPAN></P><TABLE><THEAD><TR><TH>Language feature
     </TH><TH>Strong native semantics <SPAN class="impl">and implied ARIA semantics</SPAN>

   </TH></TR></THEAD><TBODY><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> element that represents a <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink">hyperlink</A>
     </TD><TD><CODE title="attr-aria-role-link">link</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-address-element">address</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-contentinfo">contentinfo</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE> element that represents a <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink">hyperlink</A>
     </TD><TD><CODE title="attr-aria-role-link">link</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-button-element">button</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-button">button</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-datalist-element">datalist</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-listbox">listbox</CODE> role, with the <CODE title="attr-aria-multiselectable">aria-multiselectable</CODE> property set to "false"

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-footer-element">footer</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-contentinfo">contentinfo</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h1</A></CODE> element that does not have an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> ancestor
     </TD><TD><CODE title="attr-aria-role-heading">heading</CODE> role, with the <CODE title="attr-aria-level">aria-level</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#outline-depth">outline depth</A>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h2</A></CODE> element that does not have an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> ancestor
     </TD><TD><CODE title="attr-aria-role-heading">heading</CODE> role, with the <CODE title="attr-aria-level">aria-level</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#outline-depth">outline depth</A>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h3</A></CODE> element that does not have an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> ancestor
     </TD><TD><CODE title="attr-aria-role-heading">heading</CODE> role, with the <CODE title="attr-aria-level">aria-level</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#outline-depth">outline depth</A>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h4</A></CODE> element that does not have an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> ancestor
     </TD><TD><CODE title="attr-aria-role-heading">heading</CODE> role, with the <CODE title="attr-aria-level">aria-level</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#outline-depth">outline depth</A>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h5</A></CODE> element that does not have an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> ancestor
     </TD><TD><CODE title="attr-aria-role-heading">heading</CODE> role, with the <CODE title="attr-aria-level">aria-level</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#outline-depth">outline depth</A>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements">h6</A></CODE> element that does not have an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> ancestor
     </TD><TD><CODE title="attr-aria-role-heading">heading</CODE> role, with the <CODE title="attr-aria-level">aria-level</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#outline-depth">outline depth</A>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hgroup-element">hgroup</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-heading">heading</CODE> role, with the <CODE title="attr-aria-level">aria-level</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#outline-depth">outline depth</A>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-hr-element">hr</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-separator">separator</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-img-element">img</A></CODE> element whose <CODE title="attr-img-alt"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-img-alt">alt</A></CODE> attribute's value is empty
     </TD><TD><CODE title="attr-aria-role-presentation">presentation</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#button-state" title="attr-input-type-button">Button</A> state
     </TD><TD><CODE title="attr-aria-role-button">button</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#checkbox-state" title="attr-input-type-checkbox">Checkbox</A> state
     </TD><TD><CODE title="attr-aria-role-checkbox">checkbox</CODE> role, with the <CODE title="attr-aria-checked">aria-checked</CODE> state set to "mixed" if the element's <CODE title="dom-input-indeterminate"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-input-indeterminate">indeterminate</A></CODE> IDL attribute is true, or "true" if the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fe-checked" title="concept-fe-checked">checkedness</A> is true, or "false" otherwise

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#color-state" title="attr-input-type-color">Color</A> state
     </TD><TD>No role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#date-state" title="attr-input-type-date">Date</A> state
     </TD><TD>No role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#date-and-time-state" title="attr-input-type-datetime">Date and Time</A> state
     </TD><TD>No role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#local-date-and-time-state" title="attr-input-type-datetime-local">Local Date and Time</A> state
     </TD><TD>No role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#e-mail-state" title="attr-input-type-email">E-mail</A> state with no <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-list" title="concept-input-list">suggestions source element</A>
     </TD><TD><CODE title="attr-aria-role-textbox">textbox</CODE> role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#file-upload-state" title="attr-input-type-file">File Upload</A> state
     </TD><TD><CODE title="attr-aria-role-button">button</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#hidden-state" title="attr-input-type-hidden">Hidden</A> state
     </TD><TD>No role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#image-button-state" title="attr-input-type-image">Image Button</A> state
     </TD><TD><CODE title="attr-aria-role-button">button</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#month-state" title="attr-input-type-month">Month</A> state
     </TD><TD>No role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#number-state" title="attr-input-type-number">Number</A> state
     </TD><TD><CODE title="attr-aria-role-spinbutton">spinbutton</CODE> role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute, the <CODE title="attr-aria-valuemax">aria-valuemax</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-max" title="concept-input-max">maximum</A>, the <CODE title="attr-aria-valuemin">aria-valuemin</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-min" title="concept-input-min">minimum</A>, and, if the result of applying the <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-floating-point-number-values">rules for parsing floating point number values</A> to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fe-value" title="concept-fe-value">value</A> is a number, with the <CODE title="attr-aria-valuenow">aria-valuenow</CODE> property set to that number

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#password-state" title="attr-input-type-password">Password</A> state
     </TD><TD><CODE title="attr-aria-role-textbox">textbox</CODE> role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#radio-button-state" title="attr-input-type-radio">Radio Button</A> state
     </TD><TD><CODE title="attr-aria-role-radio">radio</CODE> role, with the <CODE title="attr-aria-checked">aria-checked</CODE> state set to "true" if the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fe-checked" title="concept-fe-checked">checkedness</A> is true, or "false" otherwise

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#range-state" title="attr-input-type-range">Range</A> state
     </TD><TD><CODE title="attr-aria-role-slider">slider</CODE> role, with the <CODE title="attr-aria-valuemax">aria-valuemax</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-max" title="concept-input-max">maximum</A>, the <CODE title="attr-aria-valuemin">aria-valuemin</CODE> property set to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-min" title="concept-input-min">minimum</A>, and the <CODE title="attr-aria-valuenow">aria-valuenow</CODE> property set to the result of applying the <A href="http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-floating-point-number-values">rules for parsing floating point number values</A> to the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fe-value" title="concept-fe-value">value</A>, if that that results in a number, or the <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-value-default-range" title="concept-input-value-default-range">default value</A> otherwise

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#reset-button-state" title="attr-input-type-reset">Reset Button</A> state
     </TD><TD><CODE title="attr-aria-role-button">button</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#text-state-and-search-state" title="attr-input-type-search">Search</A> state with no <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-list" title="concept-input-list">suggestions source element</A>
     </TD><TD><CODE title="attr-aria-role-textbox">textbox</CODE> role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#submit-button-state" title="attr-input-type-submit">Submit Button</A> state
     </TD><TD><CODE title="attr-aria-role-button">button</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#telephone-state" title="attr-input-type-tel">Telephone</A> state with no <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-list" title="concept-input-list">suggestions source element</A>
     </TD><TD><CODE title="attr-aria-role-textbox">textbox</CODE> role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#text-state-and-search-state" title="attr-input-type-text">Text</A> state with no <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-list" title="concept-input-list">suggestions source element</A>
     </TD><TD><CODE title="attr-aria-role-textbox">textbox</CODE> role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#text-state-and-search-state" title="attr-input-type-text">Text</A>, <A href="http://dev.w3.org/html5/spec/Overview.html#text-state-and-search-state" title="attr-input-type-search">Search</A>, <A href="http://dev.w3.org/html5/spec/Overview.html#telephone-state" title="attr-input-type-tel">Telephone</A>, <A href="http://dev.w3.org/html5/spec/Overview.html#url-state" title="attr-input-type-url">URL</A>, or <A href="http://dev.w3.org/html5/spec/Overview.html#e-mail-state" title="attr-input-type-email">E-mail</A> states with a <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-list" title="concept-input-list">suggestions source element</A>
     </TD><TD><CODE title="attr-aria-role-combobox">combobox</CODE> role, with the <CODE title="attr-aria-owns">aria-owns</CODE> property set to the same value as the <CODE title="attr-input-list"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-list">list</A></CODE> attribute, and the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#time-state" title="attr-input-type-time">Time</A> state
     </TD><TD>No role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#url-state" title="attr-input-type-url">URL</A> state with no <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-list" title="concept-input-list">suggestions source element</A>
     </TD><TD><CODE title="attr-aria-role-textbox">textbox</CODE> role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element with a <CODE title="attr-input-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#week-state" title="attr-input-type-week">Week</A> state
     </TD><TD>No role, with the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-input-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-input-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element that represents a <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink">hyperlink</A>
     </TD><TD><CODE title="attr-aria-role-link">link</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE> element with a <CODE title="attr-menu-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-menu-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#context-menu-state" title="context menu state">context menu</A> state
     </TD><TD>No role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE> element with a <CODE title="attr-menu-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-menu-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#list-state" title="list state">list</A> state
     </TD><TD><CODE title="attr-aria-role-menu">menu</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE> element with a <CODE title="attr-menu-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-menu-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#toolbar-state" title="toolbar state">toolbar</A> state
     </TD><TD><CODE title="attr-aria-role-toolbar">toolbar</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-nav-element">nav</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-navigation">navigation</CODE> role

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-option-element">option</A></CODE> element that is in a <A href="http://dev.w3.org/html5/spec/Overview.html#concept-select-option-list" title="concept-select-option-list">list of options</A> or that represents a suggestion in a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-datalist-element">datalist</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-option">option</CODE> role, with the <CODE title="attr-aria-selected">aria-selected</CODE> state set to "true" if the element's <A href="http://dev.w3.org/html5/spec/Overview.html#concept-option-selectedness" title="concept-option-selectedness">selectedness</A> is true, or "false" otherwise.

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-progress-element">progress</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-progressbar">progressbar</CODE> role, with, if the progress bar is determinate, the <CODE title="attr-aria-valuemax">aria-valuemax</CODE> property set to the maximum value of the progress bar, the <CODE title="attr-aria-valuemin">aria-valuemin</CODE> property set to zero, and the <CODE title="attr-aria-valuenow">aria-valuenow</CODE> property set to the current value of the progress bar

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE> element with a <CODE title="attr-select-multiple"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-select-multiple">multiple</A></CODE> attribute
     </TD><TD><CODE title="attr-aria-role-listbox">listbox</CODE> role, with the <CODE title="attr-aria-multiselectable">aria-multiselectable</CODE> property set to "true"

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-select-element">select</A></CODE> element with no <CODE title="attr-select-multiple"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-select-multiple">multiple</A></CODE> attribute
     </TD><TD><CODE title="attr-aria-role-listbox">listbox</CODE> role, with the <CODE title="attr-aria-multiselectable">aria-multiselectable</CODE> property set to "false"

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-td-element">td</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-gridcell">gridcell</CODE> role, with the <CODE title="attr-aria-labelledby">aria-labelledby</CODE> property set to the value of the <CODE title="attr-tdth-headers"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-tdth-headers">headers</A></CODE> attribute, if any

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-textarea-element">textarea</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-textbox">textbox</CODE> role, with the <CODE title="attr-aria-multiline">aria-multiline</CODE> property set to "true", and the <CODE title="title-aria-readonly">aria-readonly</CODE> state set to "true" if the element has a <CODE title="attr-textarea-readonly"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-textarea-readonly">readonly</A></CODE> attribute

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-th-element">th</A></CODE> element that is neither a <A href="http://dev.w3.org/html5/spec/Overview.html#column-header">column header</A> nor a <A href="http://dev.w3.org/html5/spec/Overview.html#row-header">row header</A>
     </TD><TD><CODE title="attr-aria-role-gridcell">gridcell</CODE> role, with the <CODE title="attr-aria-labelledby">aria-labelledby</CODE> property set to the value of the <CODE title="attr-tdth-headers"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-tdth-headers">headers</A></CODE> attribute, if any

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-th-element">th</A></CODE> element that is a <A href="http://dev.w3.org/html5/spec/Overview.html#column-header">column header</A>
     </TD><TD><CODE title="attr-aria-role-columnheader">columnheader</CODE> role, with the <CODE title="attr-aria-labelledby">aria-labelledby</CODE> property set to the value of the <CODE title="attr-tdth-headers"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-tdth-headers">headers</A></CODE> attribute, if any

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-th-element">th</A></CODE> element that is a <A href="http://dev.w3.org/html5/spec/Overview.html#row-header">row header</A>
     </TD><TD><CODE title="attr-aria-role-rowheader">rowheader</CODE> role, with the <CODE title="attr-aria-labelledby">aria-labelledby</CODE> property set to the value of the <CODE title="attr-tdth-headers"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-tdth-headers">headers</A></CODE> attribute, if any

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-tr-element">tr</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-row">row</CODE> role

    </TD></TR><TR><TD>An element that <A href="http://dev.w3.org/html5/spec/Overview.html#concept-command" title="concept-command">defines a command</A>, whose <A href="http://dev.w3.org/html5/spec/Overview.html#command-facet-type" title="command-facet-type">Type</A> facet is "checkbox", and that is a descendant of a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE> element whose <CODE title="attr-menu-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-menu-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#list-state" title="list state">list</A> state
     </TD><TD><CODE title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</CODE> role, with the <CODE title="attr-aria-checked">aria-checked</CODE> state set to "true" if the command's <A href="http://dev.w3.org/html5/spec/Overview.html#command-facet-checkedstate" title="command-facet-checkedstate">Checked State</A> facet is true, and "false" otherwise

    </TD></TR><TR><TD>An element that <A href="http://dev.w3.org/html5/spec/Overview.html#concept-command" title="concept-command">defines a command</A>, whose <A href="http://dev.w3.org/html5/spec/Overview.html#command-facet-type" title="command-facet-type">Type</A> facet is "command", and that is a descendant of a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE> element whose <CODE title="attr-menu-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-menu-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#list-state" title="list state">list</A> state
     </TD><TD><CODE title="attr-aria-role-menuitem">menuitem</CODE> role

    </TD></TR><TR><TD>An element that <A href="http://dev.w3.org/html5/spec/Overview.html#concept-command" title="concept-command">defines a command</A>, whose <A href="http://dev.w3.org/html5/spec/Overview.html#command-facet-type" title="command-facet-type">Type</A> facet is "radio", and that is a descendant of a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#menus">menu</A></CODE> element whose <CODE title="attr-menu-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-menu-type">type</A></CODE> attribute in the <A href="http://dev.w3.org/html5/spec/Overview.html#list-state" title="list state">list</A> state
     </TD><TD><CODE title="attr-aria-role-menuitemradio">menuitemradio</CODE> role, with the <CODE title="attr-aria-checked">aria-checked</CODE> state set to "true" if the command's <A href="http://dev.w3.org/html5/spec/Overview.html#command-facet-checkedstate" title="command-facet-checkedstate">Checked State</A> facet is true, and "false" otherwise

    </TD></TR><TR><TD>Elements that are <A href="http://dev.w3.org/html5/spec/Overview.html#concept-fe-disabled" title="concept-fe-disabled">disabled</A>
     </TD><TD>The <CODE title="title-aria-disabled">aria-disabled</CODE> state set to "true"

    </TD></TR><TR><TD>Elements that are <A href="http://dev.w3.org/html5/spec/Overview.html#concept-input-required" title="concept-input-required">required</A>
     </TD><TD>The <CODE title="title-aria-required">aria-required</CODE> state set to "true"

  </TD></TR></TBODY></TABLE><P>Some <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML elements</A> have native semantics that can be
  overridden. The following table lists these elements<SPAN class="impl"> and their <SPAN>implicit ARIA semantics</SPAN></SPAN>,
  along with the restrictions that apply to those elements. Each
  language feature (element or attribute) in a cell in the first
  column implies, unless otherwise overriden, the ARIA semantic (role,
  state, or property) given in the cell in the second column of the
  same row, but this semantic may be overridden under the conditions
  listed in the cell in the third column of that row.</P><TABLE><THEAD><TR><TH>Language feature
     </TH><TH>Default implied ARIA semantic
     </TH><TH>Restrictions

   </TH></TR></THEAD><TBODY><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-article-element">article</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-article">article</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-article">article</CODE>, <CODE title="attr-aria-role-document">document</CODE>, <CODE title="attr-aria-role-application">application</CODE>, or <CODE title="attr-aria-role-main">main</CODE>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-aside-element">aside</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-note">note</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-note">note</CODE>, <CODE title="attr-aria-role-complementary">complementary</CODE>, or <CODE title="attr-aria-role-search">search</CODE>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-header-element">header</A></CODE> element
     </TD><TD>No role
     </TD><TD>If specified, role must be <CODE title="attr-aria-role-banner">banner</CODE>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-li-element">li</A></CODE> element whose parent is an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ol-element">ol</A></CODE> or <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ul-element">ul</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-listitem">listitem</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-listitem">listitem</CODE> or <CODE title="attr-aria-role-treeitem">treeitem</CODE>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ol-element">ol</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-list">list</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-list">list</CODE>, <CODE title="attr-aria-role-tree">tree</CODE>, or <CODE title="attr-aria-role-directory">directory</CODE>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-output-element">output</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-status">status</CODE> role
     </TD><TD>No restrictions

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-section-element">section</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-region">region</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-region">region</CODE>, <CODE title="attr-aria-role-document">document</CODE>, <CODE title="attr-aria-role-application">application</CODE>, <CODE title="attr-aria-role-contentinfo">contentinfo</CODE>, <CODE title="attr-aria-role-main">main</CODE>, <CODE title="attr-aria-role-search">search</CODE>, <CODE title="attr-aria-role-alert">alert</CODE>, <CODE title="attr-aria-role-dialog">dialog</CODE>, <CODE title="attr-aria-role-alertdialog">alertdialog</CODE>, <CODE title="attr-aria-role-status">status</CODE>, or <CODE title="attr-aria-role-log">log</CODE>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-table-element">table</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-grid">grid</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-grid">grid</CODE> or <CODE title="attr-aria-role-treegrid">treegrid</CODE>

    </TD></TR><TR><TD><CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-ul-element">ul</A></CODE> element
     </TD><TD><CODE title="attr-aria-role-list">list</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-list">list</CODE> or <CODE title="attr-aria-role-tree">tree</CODE>, or <CODE title="attr-aria-role-directory">directory</CODE>

    </TD></TR><TR><TD><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element">The body element</A>
     </TD><TD><CODE title="attr-aria-role-document">document</CODE> role
     </TD><TD>Role must be either <CODE title="attr-aria-role-document">document</CODE> or <CODE title="attr-aria-role-application">application</CODE>

  </TD></TR></TBODY></TABLE><DIV class="impl">

  <P>User agents may apply different defaults than those described in
  this section in order to expose the semantics of <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML
  elements</A> in a manner more fine-grained than possible with the
  above definitions.</P>

  <P>Conformance checkers are encouraged to phrase errors such that
  authors are encouraged to use more appropriate elements rather than
  remove accessibility annotations. For example, if an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>
  element is marked as having the <CODE title="attr-aria-role-button">button</CODE> role, a conformance
  checker could say "Either a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-button-element">button</A></CODE> element or an
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-input-element">input</A></CODE> element is required when using the <CODE title="attr-aria-role-button">button</CODE> role" rather than "The
  <CODE title="attr-aria-role-button">button</CODE> role cannot be
  used with <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE> elements".</P>

  </DIV><H3 id="apis-in-html-documents"><SPAN class="secno">3.3 </SPAN>APIs in HTML documents</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>For <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A>, and for <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements">HTML
  elements</A> in <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A>, certain APIs defined
  in DOM Core become case-insensitive or case-changing, as sometimes
  defined in DOM Core, and as summarized <SPAN class="impl">or
  required</SPAN> below. <A href="http://dev.w3.org/html5/spec/Overview.html#refsDOMCORE">[DOMCORE]</A></P><P>This does not apply to <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A> or to elements
  that are not in the <A href="http://dev.w3.org/html5/spec/Overview.html#html-namespace-0">HTML namespace</A> despite being in
  <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A>.</P><DL><DT><CODE title="">Element.tagName</CODE> and <CODE title="">Node.nodeName</CODE></DT>

   <DD>

    <P>These attributes <SPAN class="impl">must</SPAN> return element
    names <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-uppercase">converted to ASCII uppercase</A>, regardless of the case
    with which they were created.</P>

   </DD>


   <DT><CODE title="">Document.createElement()</CODE></DT>

   <DD>

    <P>The canonical form of HTML markup is all-lowercase; thus, this
    method will <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase" title="converted to ASCII lowercase">lowercase</A>
    the argument before creating the requisite element. <SPAN class="impl">Also, the element created must be in the <A href="http://dev.w3.org/html5/spec/Overview.html#html-namespace-0">HTML
    namespace</A></SPAN>.</P>

    <P class="note">This doesn't apply to <CODE title="">Document.createElementNS()</CODE>. Thus, it is possible,
    by passing this last method a tag name in the wrong case, to
    create an element that appears to have the same tag name as that
    of an element defined in this specification when its <CODE title="dom-tagName">tagName</CODE> attribute is examined, but that
    doesn't support the corresponding interfaces. The "real" element
    name (unaffected by case conversions) can be obtained from the
    <CODE title="dom-localName">localName</CODE> attribute.</P>

   </DD>


   <DT><CODE title="">Element.setAttribute()</CODE></DT>
   <DT><CODE title="">Element.setAttributeNode()</CODE></DT>

   <DD>

    <P>Attribute names are <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</A>.</P>

    <DIV class="impl">

     <P>Specifically: when an attribute is set on an <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML
     elements">HTML element</A> using <CODE title="">Element.setAttribute()</CODE>, the name argument must be
     <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</A> before the element is
     affected; and when an <CODE>Attr</CODE> node is set on an <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML element</A> using <CODE title="">Element.setAttributeNode()</CODE>, it must have its name
     <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</A> before the element is
     affected.</P>

    </DIV>

    <P class="note">This doesn't apply to <CODE title="">Document.setAttributeNS()</CODE> and <CODE title="">Document.setAttributeNodeNS()</CODE>.</P>

   </DD>


   <DT><CODE title="">Element.getAttribute()</CODE></DT>
   <DT><CODE title="">Element.getAttributeNode()</CODE></DT>

   <DD>

    <P>Attribute names are <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</A>.</P>

    <DIV class="impl">

     <P>Specifically: When the <CODE title="">Element.getAttribute()</CODE> method or the <CODE title="">Element.getAttributeNode()</CODE> method is invoked on
     an <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML element</A>, the name
     argument must be <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</A> before the
     element's attributes are examined.</P>

    </DIV>

    <P class="note">This doesn't apply to <CODE title="">Document.getAttributeNS()</CODE> and <CODE title="">Document.getAttributeNodeNS()</CODE>.</P>

   </DD>


   <DT><CODE title="">Document.getElementsByTagName()</CODE></DT>
   <DT><CODE title="">Element.getElementsByTagName()</CODE></DT>

   <DD>

    <P>HTML elements match by lower-casing the argument before
    comparison, elements from other namespaces are treated as in XML
    (case-sensitively).</P>

    <DIV class="impl">

    <P>Specifically, these methods (but not their namespaced
    counterparts) must compare the given argument in a
    <A href="http://dev.w3.org/html5/spec/Overview.html#case-sensitive">case-sensitive</A> manner, but when looking at <A href="http://dev.w3.org/html5/spec/Overview.html#html-elements" title="HTML elements">HTML elements</A>, the argument must
    first be <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</A>.</P>

    </DIV>

    <P class="note">Thus, in an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML
    document</A> with nodes in multiple namespaces, these methods
    will effectively be both case-sensitive and case-insensitive at
    the same time.</P>

   </DD>


  </DL><DIV class="impl">

  <H3 id="interactions-with-xpath-and-xslt"><SPAN class="secno">3.4 </SPAN>Interactions with XPath and XSLT</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P>

  <P id="xpath-1.0-processors">Implementations of XPath 1.0 that
  operate on HTML documents parsed or created in the manners described
  in this specification (e.g. as part of the <CODE title="">document.evaluate()</CODE> API) must act as if the
  following edit was applied to the XPath 1.0 specification.</P>

  <P>First, remove this paragraph:</P>

  <BLOCKQUOTE cite="./HTML5_files/REC-xpath-19991116">

   <P>A <A href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</A> in the
   node test is expanded into an <A href="http://www.w3.org/TR/1999/REC-xpath-19991116#dt-expanded-name">expanded-name</A>
   using the namespace declarations from the expression context.  This
   is the same way expansion is done for element type names in start
   and end-tags except that the default namespace declared with <CODE title="">xmlns</CODE> is not used: if the <A href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</A> does
   not have a prefix, then the namespace URI is null (this is the same
   way attribute names are expanded).  It is an error if the <A href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</A> has a
   prefix for which there is no namespace declaration in the
   expression context.</P>

  </BLOCKQUOTE>

  <P>Then, insert in its place the following:</P>

  <BLOCKQUOTE cite="./HTML5_files/show_bug.cgi">

   <P>A QName in the node test is expanded into an expanded-name using
   the namespace declarations from the expression context. If the
   QName has a prefix, then there must be a<!-- added 2009-10-27 -
   http://www.w3.org/Bugs/Public/show_bug.cgi?id=8062 --> namespace
   declaration for this prefix in the expression context, and the
   corresponding<!-- typo fixed 2009-10-27 -
   http://www.w3.org/Bugs/Public/show_bug.cgi?id=8063 --> namespace
   URI is the one that is associated with this prefix.  It is an error
   if the QName has a prefix for which there is no namespace
   declaration in the expression context. </P>

   <P>If the QName has no prefix and the principal node type of the
   axis is element, then the default element namespace is
   used. Otherwise if the QName has no prefix, the namespace URI is
   null. The default element namespace is a member of the context for
   the XPath expression. The value of the default element namespace
   when executing an XPath expression through the DOM3 XPath API is
   determined in the following way:</P>

   <OL><LI>If the context node is from an HTML DOM, the default element
    namespace is "http://www.w3.org/1999/xhtml".</LI>

    <LI>Otherwise, the default element namespace URI is null.</LI>

   </OL><P class="note">This is equivalent to adding the default element
   namespace feature of XPath 2.0 to XPath 1.0, and using the HTML
   namespace as the default element namespace for HTML documents. It
   is motivated by the desire to have implementations be compatible
   with legacy HTML content while still supporting the changes that
   this specification introduces to HTML regarding the namespace used
   for HTML elements, and by the desire to use XPath 1.0 rather than
   XPath 2.0.</P>

  </BLOCKQUOTE>

  <P class="note">This change is a <A href="http://dev.w3.org/html5/spec/Overview.html#willful-violation">willful violation</A> of
  the XPath 1.0 specification, motivated by desire to have
  implementations be compatible with legacy content while still
  supporting the changes that this specification introduces to HTML
  regarding which namespace is used for HTML elements. <A href="http://dev.w3.org/html5/spec/Overview.html#refsXPATH10">[XPATH10]</A></P> <!-- note: version matters for
  this ref -->

  <HR><P id="dom-based-xslt-1.0-processors">XSLT 1.0 processors outputting
  to a DOM when the output method is "html" (either explicitly or via
  the defaulting rule in XSLT 1.0) are affected as follows:</P>

  <P>If the transformation program outputs an element in no namespace,
  the processor must, prior to constructing the corresponding DOM
  element node, change the namespace of the element to the <A href="http://dev.w3.org/html5/spec/Overview.html#html-namespace-0">HTML
  namespace</A>, <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase" title="converted to ASCII
  lowercase">ASCII-lowercase</A> the element's local name, and
  <A href="http://dev.w3.org/html5/spec/Overview.html#converted-to-ascii-lowercase" title="converted to ASCII lowercase">ASCII-lowercase</A>
  the names of any non-namespaced attributes on the element.</P>

  <P class="note">This requirement is a <A href="http://dev.w3.org/html5/spec/Overview.html#willful-violation">willful violation</A>
  of the XSLT 1.0 specification, required because this specification
  changes the namespaces and case-sensitivity rules of HTML in a
  manner that would otherwise be incompatible with DOM-based XSLT
  transformations. (Processors that serialize the output are
  unaffected.) <A href="http://dev.w3.org/html5/spec/Overview.html#refsXSLT10">[XSLT10]</A></P> <!-- note:
  version matters for this ref -->

  </DIV><H3 id="dynamic-markup-insertion"><SPAN class="secno">3.5 </SPAN><DFN>Dynamic markup insertion</DFN></H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P class="note">APIs for dynamically inserting markup into the
  document interact with the parser, and thus their behavior varies
  depending on whether they are used with <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents">HTML documents</A>
  (and the <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A>) or XHTML in <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML
  documents</A> (and the <A href="http://dev.w3.org/html5/spec/Overview.html#xml-parser">XML parser</A>).</P><H4 id="opening-the-input-stream"><SPAN class="secno">3.5.1 </SPAN>Opening the input stream</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <DFN id="dom-document-open" title="dom-document-open"><CODE>open()</CODE></DFN>
  method comes in several variants with different numbers of
  arguments.</P><DL class="domintro"><DT><VAR title="">document</VAR> = <VAR title="">document</VAR> . <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">open</A></CODE>( [ <VAR title="">type</VAR> [, <VAR title="">replace</VAR> ] ] )</DT>

   <DD>

    <P>Causes the <CODE>Document</CODE> to be replaced in-place, as if
    it was a new <CODE>Document</CODE> object, but reusing the
    previous object, which is then returned.</P>

    <P>If the <VAR title="">type</VAR> argument is omitted or has the
    value "<CODE><A href="http://dev.w3.org/html5/spec/Overview.html#text-html">text/html</A></CODE>", then the resulting
    <CODE>Document</CODE> has an HTML parser associated with it, which
    can be given data to parse using <CODE title="dom-document-write"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-write">document.write()</A></CODE>. Otherwise, all
    content passed to <CODE title="dom-document-write"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-write">document.write()</A></CODE> will be parsed
    as plain text.</P>

    <P>If the <VAR title="">replace</VAR> argument is present and has
    the value "<CODE title="">replace</CODE>", the existing entries in
    the session history for the <CODE>Document</CODE> object are
    removed.</P>

    <P>The method has no effect if the <CODE>Document</CODE> is still
    being parsed.</P>

    <P>Throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> exception if the
    <CODE>Document</CODE> is an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML documents">XML
    document</A>.</P>

   </DD>

   <DT><VAR title="">window</VAR> = <VAR title="">document</VAR> . <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">open</A></CODE>( <VAR title="">url</VAR>, <VAR title="">name</VAR>, <VAR title="">features</VAR> [, <VAR title="">replace</VAR> ] )</DT>

   <DD>

    <P>Works like the <CODE title="dom-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-open">window.open()</A></CODE>
    method.</P>

   </DD>

  </DL><DIV class="impl">

  <P>When called with two or fewer arguments, the method must act as
  follows:</P>

  <OL><LI>If the <CODE>Document</CODE> object is not flagged as an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML document</A>, throw an
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> exception and abort these
   steps.</LI>

   <LI><P>Let <VAR title="">type</VAR> be the value of the first
   argument, if there is one, or "<CODE><A href="http://dev.w3.org/html5/spec/Overview.html#text-html">text/html</A></CODE>"
   otherwise.</P></LI>

   <LI><P>Let <VAR title="">replace</VAR> be true if there is a second
   argument and it is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII case-insensitive</A> match for
   the value "replace", and false otherwise.</P></LI>

   <LI>

    <P>If the document has an <A href="http://dev.w3.org/html5/spec/Overview.html#active-parser">active parser</A> that isn't a
    <A href="http://dev.w3.org/html5/spec/Overview.html#script-created-parser">script-created parser</A>, and the <A href="http://dev.w3.org/html5/spec/Overview.html#insertion-point">insertion
    point</A> associated with that parser's <A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream">input
    stream</A> is not undefined (that is, it <EM>does</EM> point to
    somewhere in the input stream), then the method does
    nothing. Abort these steps and return the <CODE>Document</CODE>
    object on which the method was invoked.</P>

    <P class="note">This basically causes <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">document.open()</A></CODE> to be ignored
    when it's called in an inline script found during the parsing of
    data sent over the network, while still letting it have an effect
    when called asynchronously or on a document that is itself being
    spoon-fed using these APIs.</P>

   </LI>

   <LI><P>Release the <A href="http://dev.w3.org/html5/spec/Overview.html#storage-mutex">storage mutex</A>.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#prompt-to-unload-a-document" title="prompt to unload a document">Prompt to
   unload</A> the <CODE>Document</CODE> object. If the user
   <A href="http://dev.w3.org/html5/spec/Overview.html#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</A>, then
   these steps must be aborted.</P></LI>

   <LI><P><A href="http://dev.w3.org/html5/spec/Overview.html#unload-a-document" title="unload a document">Unload</A> the
   <CODE>Document</CODE> object, with the <VAR title="">recycle</VAR>
   parameter set to true.</P></LI>

   <LI><P>If the document has an <A href="http://dev.w3.org/html5/spec/Overview.html#active-parser">active parser</A>, then
   abort that parser, and throw away any pending content in the
   <A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream">input stream</A>.</P></LI>

   <LI><P>Unregister all event listeners registered on the
   <CODE>Document</CODE> node and its descendants.</P>

   </LI><LI><P>Remove any <A href="http://dev.w3.org/html5/spec/Overview.html#concept-task" title="concept-task">tasks</A>
   associated with the <CODE>Document</CODE> in any <A href="http://dev.w3.org/html5/spec/Overview.html#task-source">task
   source</A>.</P></LI> <!-- removes callbacks that fired between
   this algorithm starting and the times and databases being aborted
   in the "unload" step above -->

   <LI><P>Remove all child nodes of the document, without firing any
   mutation events.</P></LI> <!-- as of 2009-03-30, only WebKit fired
   mutation events here. -->

   <LI><P>Replace the <CODE>Document</CODE>'s singleton objects with
   new instances of those objects. (This includes in particular the
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#window">Window</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#location">Location</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#history-0">History</A></CODE>,
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#applicationcache">ApplicationCache</A></CODE>, <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#undomanager">UndoManager</A></CODE>,
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#navigator">Navigator</A></CODE>, and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#selection-0">Selection</A></CODE> objects, the
   various <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#barprop">BarProp</A></CODE> objects, the two <CODE>Storage</CODE>
   objects, and the various <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmlcollection">HTMLCollection</A></CODE> objects. It
   also includes all the Web IDL prototypes in the JavaScript binding,
   including the <CODE>Document</CODE> object's prototype.)</P></LI>

   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%20src%3D%22document%22%3E%3C%2Fiframe%3E%0A%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20f%20%3D%20document.getElementsByTagName('iframe')%5B0%5D%3B%20d%20%3D%20f.contentWindow.document%3B%20%7D%3C%2Fscript%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22w(d.documentElement.innerHTML)%22%20value%3D%22dump%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write('%3Cscript%3Evar%20x%20%3D%20new%20XMLHttpRequest()%3Bx.open(%26quot%3BGET%26quot%3B%2C%20%26quot%3BGET%26quot%3B)%3Bx.onreadystatechange%3Dfunction()%20%7B%20alert(x.readyState)%3B%20%7D%3Bx.send(null)%3B%3C%2Fscript%3E')%3Bd.close()%3B%20setTimeout(function()%20%7B%20d.open()%3B%20d.write('%3Cp%3Etest%3C%2Fp%3E')%3B%20d.close()%20%7D%2C%200)%3B%22%20value%3D%22xhr%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.onclick%20%3D%20function()%20%7B%20w('click')%20%7D%22%20value%3D%22add%20click%20handler%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write('%3Cp%3Etest%3C%2Fp%3E')%3B%20d.close()%22%20value%3D%22replace%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write('%3Cp%3E%3Cscript%3Ei%20%3D%200%3B%20setTimeout(%26quot%3Bparent.w(i%2B%2B)%26quot%3B%2C%202000)%3C%2Fscript%3E%3C%2Fp%3E')%3B%20d.close()%22%20value%3D%22replace%20with%20timer%22%3E -->
   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A...%3Ciframe%3E%3C%2Fiframe%3E%0D%0A%3Cscript%3E%0D%0Aonload%20%3D%20function%20()%20%7B%0D%0A%20frames%5B0%5D.test%20%3D%201%0D%0A%20w(frames%5B0%5D.test)%3B%0D%0A%20var%20a%20%3D%20frames%5B0%5D.document.location.assign%3B%0D%0A%20w(a)%3B%0D%0A%20w(frames%5B0%5D.document.location.assign%20%3D%3D%3D%20a)%3B%0D%0A%20frames%5B0%5D.document.open()%3B%0D%0A%20frames%5B0%5D.document.write('%3Cscript%3Edocument.write(test)%3C%5C%2Fscript%3E')%3B%0D%0A%20frames%5B0%5D.document.close()%3B%0D%0A%20w(frames%5B0%5D.test)%3B%0D%0A%20w(frames%5B0%5D.document.location.assign%20%3D%3D%3D%20a)%3B%0D%0A%7D%0D%0A%3C%2Fscript%3E -->

   <LI><P>Change the <A href="http://dev.w3.org/html5/spec/Overview.html#document-s-character-encoding">document's character encoding</A> to
   UTF-16.</P></LI>

   <LI><P>Change <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address">the document's address</A> to the
   <A href="http://dev.w3.org/html5/spec/Overview.html#entry-script">entry script</A>'s <A href="http://dev.w3.org/html5/spec/Overview.html#script-s-browsing-context" title="script&#39;s browsing
   context">browsing context</A>'s <A href="http://dev.w3.org/html5/spec/Overview.html#active-document">active document</A>'s
   <A href="http://dev.w3.org/html5/spec/Overview.html#the-document-s-address" title="the document&#39;s address">address</A>.</P></LI>

   <LI><P>Create a new <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A> and associate it with
   the document. This is a <DFN id="script-created-parser">script-created parser</DFN> (meaning
   that it can be closed by the <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">document.open()</A></CODE> and <CODE title="dom-document-close"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-close">document.close()</A></CODE> methods, and
   that the tokenizer will wait for an explicit call to <CODE title="dom-document-close"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-close">document.close()</A></CODE> before emitting
   an end-of-file token). The encoding <A href="http://dev.w3.org/html5/spec/Overview.html#concept-encoding-confidence" title="concept-encoding-confidence">confidence</A> is
   <I>irrelevant</I>.</P></LI>

   <LI>

    <!-- text/plain handling -->

    <P>If the <VAR title="">type</VAR> string contains a U+003B
    SEMICOLON character (;), remove the first such character and all
    characters from it up to the end of the string.</P>

    <P>Strip all leading and trailing <A href="http://dev.w3.org/html5/spec/Overview.html#space-character" title="space
    character">space characters</A> from <VAR title="">type</VAR>.</P>

    <P>If <VAR title="">type</VAR> is <EM>not</EM> now an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
    case-insensitive</A> match for the string
    "<CODE><A href="http://dev.w3.org/html5/spec/Overview.html#text-html">text/html</A></CODE>", then act as if the tokenizer had emitted
    a start tag token with the tag name "pre", then switch the
    <A href="http://dev.w3.org/html5/spec/Overview.html#html-parser">HTML parser</A>'s tokenizer to the <A href="http://dev.w3.org/html5/spec/Overview.html#plaintext-state">PLAINTEXT
    state</A>.</P>

    <!--
 http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20%0D%0A%20%20var%20d%20%3D%20document.getElementsByTagName('iframe')%5B0%5D.contentDocument%3B%0D%0A%20%20d.open('image%2Fsvg%2Bxml')%3B%0D%0A%20%20d.write(%22%3Cinput%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%20value%3D'(x)html'%2F%3E%22)%3B%0D%0A%20%20d.close()%3B%0D%0A%7D%3B%3C%2Fscript%3E
 http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20%0D%0A%20%20var%20d%20%3D%20document.getElementsByTagName('iframe')%5B0%5D.contentDocument%3B%0D%0A%20%20d.open('image%2Fgif')%3B%0D%0A%20%20var%20a%20%3D%20%5B%200x47%2C%200x49%2C%200x46%2C%200x38%2C%200x39%2C%200x61%2C%200x01%2C%200x00%2C%200x01%2C%200x00%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200x80%2C%200xff%2C%200x00%2C%200xc0%2C%200xc0%2C%200xc0%2C%200x00%2C%200x00%2C%200x00%2C%200x21%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200xf9%2C%200x04%2C%200x01%2C%200x00%2C%200x00%2C%200x00%2C%200x00%2C%200x2c%2C%200x00%2C%200x00%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200x00%2C%200x00%2C%200x01%2C%200x00%2C%200x01%2C%200x00%2C%200x00%2C%200x02%2C%200x02%2C%200x44%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200x01%2C%200x00%2C%200x3b%20%5D%3B%0D%0A%20%20var%20s%20%3D%20%22%22%3B%0D%0A%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20a.length%3B%20i%20%2B%3D%201)%0D%0A%20%20%20%20s%20%2B%3D%20String.fromCharCode(a%5Bi%5D)%3B%0D%0A%20%20d.write(s)%3B%0D%0A%20%20d.close()%3B%0D%0A%7D%3B%3C%2Fscript%3E
 http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20{%20%0A%20%20var%20d%20%3D%20document.getElementsByTagName(%27iframe%27)[0].contentDocument%3B%0A%20%20d.open(%27Text%2Fplain%27)%3B%0A%20%20d.write(%27%3Cb%3Etest%27)%3B%0A%20%20d.close()%3B%0A}%3B%3C%2Fscript%3E
 http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20{%20%0A%20%20var%20d%20%3D%20document.getElementsByTagName(%27iframe%27)[0].contentDocument%3B%0A%20%20d.open(%27%20text%2Fplain%27)%3B%0A%20%20d.write(%27%3Cb%3Etest%27)%3B%0A%20%20d.close()%3B%0A}%3B%3C%2Fscript%3E
 http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20{%20%0A%20%20var%20d%20%3D%20document.getElementsByTagName(%27iframe%27)[0].contentDocument%3B%0A%20%20d.open(%27text%2Fplain%3B%27)%3B%0A%20%20d.write(%27%3Cb%3Etest%27)%3B%0A%20%20d.close()%3B%0A}%3B%3C%2Fscript%3E
    -->

   </LI>

   <LI>

    <P>Remove all the entries in the <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A>'s
    <A href="http://dev.w3.org/html5/spec/Overview.html#session-history">session history</A> after the <A href="http://dev.w3.org/html5/spec/Overview.html#current-entry">current
    entry</A>. If the <A href="http://dev.w3.org/html5/spec/Overview.html#current-entry">current entry</A> is the last entry
    in the session history, then no entries are removed.</P>

    <P class="note">This <A href="http://dev.w3.org/html5/spec/Overview.html#history-notes">doesn't necessarily
    have to affect</A> the user agent's user interface.</P>

   </LI>

   <LI>Remove any earlier entries that share the same
   <CODE>Document</CODE>.</LI>

   <LI>

    <P>If <VAR title="">replace</VAR> is false, then add a new entry,
    just before the last entry, and assocaite with the new entry the
    text that was parsed by the previous parser associated with the
    <CODE>Document</CODE> object, as well as the state of the document
    at the start of these steps. (This allows the user to step
    backwards in the session history to see the page before it was
    blown away by the <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">document.open()</A></CODE> call.)</P>

   </LI>

   <LI><P>Finally, set the <A href="http://dev.w3.org/html5/spec/Overview.html#insertion-point">insertion point</A> to point at
   just before the end of the <A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream">input stream</A> (which at this
   point will be empty).</P></LI>

   <LI><P>Return the <CODE>Document</CODE> on which the method was
   invoked.</P></LI>

  </OL><P>When called with three or more arguments, the <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">open()</A></CODE> method on the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> object must call the <CODE title="dom-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-open">open()</A></CODE> method on the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#window">Window</A></CODE>
  object of the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> object, with the same
  arguments as the original call to the <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">open()</A></CODE> method, and return whatever
  that method returned. If the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#htmldocument">HTMLDocument</A></CODE> object has no
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#window">Window</A></CODE> object, then the method must raise an
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_access_err">INVALID_ACCESS_ERR</A></CODE> exception.</P>

  </DIV><H4 id="closing-the-input-stream"><SPAN class="secno">3.5.2 </SPAN>Closing the input stream</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-close"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-close">close</A></CODE>()</DT>

   <DD>

    <P>Closes the input stream that was opened by the <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">document.open()</A></CODE> method.</P>

    <P>Throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> exception if the
    <CODE>Document</CODE> is an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML documents">XML
    document</A>.</P>

   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-document-close" title="dom-document-close"><CODE>close()</CODE></DFN>
  method must run the following steps:</P>

  <OL><LI><P>If the <CODE>Document</CODE> object is not flagged as an
   <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML document</A>, throw an
   <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> exception and abort these
   steps.</P></LI>

   <LI><P>If there is no <A href="http://dev.w3.org/html5/spec/Overview.html#script-created-parser">script-created parser</A> associated
   with the document, then abort these steps.</P></LI>

   <LI><P>Insert an <A href="http://dev.w3.org/html5/spec/Overview.html#explicit-eof-character">explicit "EOF" character</A> at the end
   of the parser's <A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream">input stream</A>.</P></LI>

   <LI><P>If there is a <A href="http://dev.w3.org/html5/spec/Overview.html#pending-parsing-blocking-script">pending parsing-blocking script</A>,
   then abort these steps.</P></LI>

   <LI><P>Run the tokenizer, processing resulting tokens as they are
   emitted, and stopping when the tokenizer reaches the <A href="http://dev.w3.org/html5/spec/Overview.html#explicit-eof-character">explicit
   "EOF" character</A> or <A href="http://dev.w3.org/html5/spec/Overview.html#spin-the-event-loop" title="spin the event loop">spins
   the event loop</A>.</P></LI>

  </OL></DIV><H4 id="document.write"><SPAN class="secno">3.5.3 </SPAN><CODE title="dom-document-write"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-write">document.write()</A></CODE></H4><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-write"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-write">write</A></CODE>(<VAR title="">text</VAR>...)</DT>

   <DD>

    <P>Adds the given string(s) to the <CODE>Document</CODE>'s input
    stream. If necessary, calls the <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">open()</A></CODE> method implicitly
    first.</P>

    <P>This method throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_access_err">INVALID_ACCESS_ERR</A></CODE> exception
    when invoked on <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>.</P>

   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-document-write" title="dom-document-write"><CODE>document.write(...)</CODE></DFN>
  method must act as follows:</P>

  <OL><LI>

    <P>If the method was invoked on an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML documents">XML
    document</A>, throw an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_access_err">INVALID_ACCESS_ERR</A></CODE>
    exception and abort these steps.</P>

    <!--
    Where would document.write() insert?
    Consider: data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ document.write('<foo>Test</foo>'); ]]></script>
    -->

   </LI>

   <LI>

    <P>If the <A href="http://dev.w3.org/html5/spec/Overview.html#insertion-point">insertion point</A> is undefined, the <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">open()</A></CODE> method must be called
    (with no arguments) on the <CODE title="Document">document</CODE>
    object. If the user <A href="http://dev.w3.org/html5/spec/Overview.html#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be
    unloaded</A>, then these steps must be aborted. Otherwise, the
    <A href="http://dev.w3.org/html5/spec/Overview.html#insertion-point">insertion point</A> will point at just before the end of
    the (empty) <A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream">input stream</A>.</P>

   </LI>

   <LI>

    <P>The string consisting of the concatenation of all the arguments
    to the method must be inserted into the <A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream">input stream</A>
    just before the <A href="http://dev.w3.org/html5/spec/Overview.html#insertion-point">insertion point</A>.</P>

   </LI>

   <LI>

    <P>If there is a <A href="http://dev.w3.org/html5/spec/Overview.html#pending-parsing-blocking-script">pending parsing-blocking script</A>, then the
    method must now return without further processing of the
    <A href="http://dev.w3.org/html5/spec/Overview.html#the-input-stream">input stream</A>.</P>

   </LI>

   <LI>

    <P>Otherwise, the tokenizer must process the characters that were
    inserted, one at a time, processing resulting tokens as they are
    emitted, and stopping when the tokenizer reaches the insertion
    point or when the processing of the tokenizer is aborted by the
    tree construction stage (this can happen if a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE>
    end tag token is emitted by the tokenizer).

    </P><P class="note">If the <CODE title="dom-document-write"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-write">document.write()</A></CODE> method was
    called from script executing inline (i.e. executing because the
    parser parsed a set of <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#script">script</A></CODE> tags), then this is a
    <A href="http://dev.w3.org/html5/spec/Overview.html#nestedParsing">reentrant invocation of the
    parser</A>.</P>

   </LI>

   <LI>

    <P>Finally, the method must return.</P>

   </LI>

  </OL></DIV><H4 id="document.writeln"><SPAN class="secno">3.5.4 </SPAN><CODE title="dom-document-writeln"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-writeln">document.writeln()</A></CODE></H4><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-document-writeln"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-writeln">writeln</A></CODE>(<VAR title="">text</VAR>...)</DT>

   <DD>

    <P>Adds the given string(s) to the <CODE>Document</CODE>'s input
    stream, followed by a newline character. If necessary, calls the
    <CODE title="dom-document-open"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-open">open()</A></CODE> method implicitly
    first.</P>

    <P>This method throws an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_access_err">INVALID_ACCESS_ERR</A></CODE> exception
    when invoked on <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>.</P>

   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-document-writeln" title="dom-document-writeln"><CODE>document.writeln(...)</CODE></DFN>
  method, when invoked, must act as if the <CODE title="dom-document-write"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-document-write">document.write()</A></CODE> method had been
  invoked with the same argument(s), plus an extra argument consisting
  of a string containing a single line feed character (U+000A).</P>

  </DIV><H4 id="innerhtml"><SPAN class="secno">3.5.5 </SPAN><CODE title="dom-innerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml">innerHTML</A></CODE></H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <DFN id="dom-innerhtml" title="dom-innerHTML"><CODE>innerHTML</CODE></DFN> IDL
  attribute represents the markup of the node's contents.</P><DL class="domintro"><DT><VAR title="">document</VAR> . <CODE title="dom-innerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml">innerHTML</A></CODE> [ = <VAR title="">value</VAR> ]</DT>

   <DD>

    <P>Returns a fragment of HTML or XML that represents the
    <CODE>Document</CODE>.</P>

    <P>Can be set, to replace the <CODE>Document</CODE>'s contents
    with the result of parsing the given string.</P>

    <P>In the case of <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>, will throw an
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> if the <CODE>Document</CODE> cannot
    be serialized to XML, and a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> if the given
    string is not well-formed.</P>

   </DD>

   <DT><VAR title="">element</VAR> . <CODE title="dom-innerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml">innerHTML</A></CODE> [ = <VAR title="">value</VAR> ]</DT>

   <DD>

    <P>Returns a fragment of HTML or XML that represents the element's
    contents.</P>

    <P>Can be set, to replace the contents of the element with nodes
    parsed from the given string.</P>

    <P>In the case of <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>, will throw an
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> if the element cannot be serialized
    to XML, and a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> if the given string is not
    well-formed.</P>

   </DD>

  </DL><DIV class="impl">

  <P>On getting, if the node's document is an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML
  documents">HTML document</A>, then the attribute must return the
  result of running the <A href="http://dev.w3.org/html5/spec/Overview.html#html-fragment-serialization-algorithm">HTML fragment serialization
  algorithm</A> on the node; otherwise, the node's document is an
  <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML documents">XML document</A>, and the attribute
  must return the result of running the <A href="http://dev.w3.org/html5/spec/Overview.html#xml-fragment-serialization-algorithm">XML fragment
  serialization algorithm</A> on the node instead (this might raise
  an exception instead of returning a string).</P>

  <P>On setting, the following steps must be run:</P>

  <OL><LI>

    <P>If the node's document is an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML
    document</A>: Invoke the <A href="http://dev.w3.org/html5/spec/Overview.html#html-fragment-parsing-algorithm">HTML fragment parsing
    algorithm</A>.</P>

    <P>If the node's document is an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML documents">XML
    document</A>: Invoke the <A href="http://dev.w3.org/html5/spec/Overview.html#xml-fragment-parsing-algorithm">XML fragment parsing
    algorithm</A>.</P>

    <P>In either case, the algorithm must be invoked with the string
    being assigned into the <CODE title="dom-innerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml">innerHTML</A></CODE> attribute as the <VAR title="">input</VAR>. If the node is an <CODE>Element</CODE>
    node, then, in addition, that element must be passed as the <VAR title="">context</VAR> element.</P>

    <P>If this raises an exception, then abort these steps.</P>

    <P>Otherwise, let <VAR title="">new children</VAR> be the nodes
    returned.</P>

   </LI>

   <LI>

    <P>If the attribute is being set on a <CODE>Document</CODE> node,
    and that document has an <A href="http://dev.w3.org/html5/spec/Overview.html#active-parser">active parser</A>, then abort
    that parser.</P>

   </LI>

   <LI>

    <P>Remove the child nodes of the node whose <CODE title="dom-innerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml">innerHTML</A></CODE> attribute is being set,
    firing appropriate mutation events.</P>

   </LI>

   <LI>

    <P>If the attribute is being set on a <CODE>Document</CODE>
    node, let <VAR title="">target document</VAR> be that
    <CODE>Document</CODE> node. Otherwise, the attribute is being
    set on an <CODE>Element</CODE> node; let <VAR title="">target
    document</VAR> be the <CODE title="">ownerDocument</CODE> of
    that <CODE>Element</CODE>.</P>

   </LI>

   <LI>

    <P>Set the <CODE title="">ownerDocument</CODE> of all the nodes in
    <VAR title="">new children</VAR> to the <VAR title="">target
    document</VAR>.</P>

   </LI>

   <LI>

    <P>Append all the <VAR title="">new children</VAR> nodes to the
    node whose <CODE title="dom-innerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-innerhtml">innerHTML</A></CODE> attribute
    is being set, preserving their order, and firing mutation events
    as if a <CODE>DocumentFragment</CODE> containing the <VAR title="">new children</VAR> had been inserted.</P>

   </LI>

  </OL></DIV><H4 id="outerhtml"><SPAN class="secno">3.5.6 </SPAN><CODE title="dom-outerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-outerhtml">outerHTML</A></CODE></H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><P>The <DFN id="dom-outerhtml" title="dom-outerHTML"><CODE>outerHTML</CODE></DFN> IDL
  attribute represents the markup of the element and its contents.</P><DL class="domintro"><DT><VAR title="">element</VAR> . <CODE title="dom-outerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-outerhtml">outerHTML</A></CODE> [ = <VAR title="">value</VAR> ]</DT>

   <DD>

    <P>Returns a fragment of HTML or XML that represents the element
    and its contents.</P>

    <P>Can be set, to replace the element with nodes parsed from the
    given string.</P>

    <P>In the case of <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML documents</A>, will throw an
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#invalid_state_err">INVALID_STATE_ERR</A></CODE> if the element cannot be serialized
    to XML, and a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> if the given string is not
    well-formed.</P>

    <P>Throws a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</A></CODE> exception if
    the parent of the element is the <CODE>Document</CODE>
    node.</P>

   </DD>

  </DL><DIV class="impl">

  <P>On getting, if the node's document is an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML
  documents">HTML document</A>, then the attribute must return the
  result of running the <A href="http://dev.w3.org/html5/spec/Overview.html#html-fragment-serialization-algorithm">HTML fragment serialization
  algorithm</A> on a fictional node whose only child is the node on
  which the attribute was invoked; otherwise, the node's document is
  an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML documents">XML document</A>, and the
  attribute must return the result of running the <A href="http://dev.w3.org/html5/spec/Overview.html#xml-fragment-serialization-algorithm">XML fragment
  serialization algorithm</A> on that fictional node instead (this
  might raise an exception instead of returning a string).</P>

  <P>On setting, the following steps must be run:</P>

  <OL><LI>

    <P>Let <VAR title="">target</VAR> be the element whose <CODE title="dom-outerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-outerhtml">outerHTML</A></CODE> attribute is being
    set.</P>

   </LI>

   <LI>

    <P>If <VAR title="">target</VAR> has no parent node, then abort
    these steps. There would be no way to obtain a reference to the
    nodes created even if the remaining steps were run.</P>

   </LI>

   <LI>

    <P>If <VAR title="">target</VAR>'s parent node is a
    <CODE>Document</CODE> object, throw a
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</A></CODE> exception and abort these
    steps.</P>

   </LI>

   <LI>

    <P>Let <VAR title="">parent</VAR> be <VAR title="">target</VAR>'s
    parent node, unless that is a <CODE>DocumentFragment</CODE> node,
    in which case let <VAR title="">parent</VAR> be an arbitrary
    <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> element.</P>

   </LI>

   <LI>

    <P>If <VAR title="">target</VAR>'s document is an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML document</A>: Invoke the <A href="http://dev.w3.org/html5/spec/Overview.html#html-fragment-parsing-algorithm">HTML
    fragment parsing algorithm</A>.</P>

    <P>If <VAR title="">target</VAR>'s document is an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML
    documents">XML document</A>: Invoke the <A href="http://dev.w3.org/html5/spec/Overview.html#xml-fragment-parsing-algorithm">XML fragment
    parsing algorithm</A>.</P>

    <P>In either case, the algorithm must be invoked with the string
    being assigned into the <CODE title="dom-outerHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-outerhtml">outerHTML</A></CODE> attribute as the <VAR title="">input</VAR>, and <VAR title="">parent</VAR> as the <VAR title="">context</VAR> element.</P>

    <P>If this raises an exception, then abort these steps.</P>

    <P>Otherwise, let <VAR title="">new children</VAR> be the nodes
    returned.</P>

   </LI>

   <LI>

    <P>Set the <CODE title="">ownerDocument</CODE> of all the nodes in
    <VAR title="">new children</VAR> to <VAR title="">target</VAR>'s
    document.</P>

   </LI>

   <LI>

    <P>Remove <VAR title="">target</VAR> from its parent node, firing
    mutation events as appropriate, and then insert in its place all
    the <VAR title="">new children</VAR> nodes, preserving their
    order, and again firing mutation events as if a
    <CODE>DocumentFragment</CODE> containing the <VAR title="">new
    children</VAR> had been inserted.</P>

   </LI>

  </OL></DIV><H4 id="insertadjacenthtml"><SPAN class="secno">3.5.7 </SPAN><CODE title="dom-insertAdjacentHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-insertadjacenthtml">insertAdjacentHTML()</A></CODE></H4><DL class="domintro"><DT><VAR title="">element</VAR> . <CODE title="dom-insertAdjacentHTML"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-insertadjacenthtml">insertAdjacentHTML</A></CODE>(<VAR title="">position</VAR>, <VAR title="">text</VAR>)</DT>

   <DD>

    <P>Parses the given string <VAR title="">text</VAR> as HTML or XML
    and inserts the resulting nodes into the tree in the position
    given by the <VAR title="">position</VAR> argument, as
    follows:</P>

    <DL><DT>"beforebegin"</DT>
     <DD>Before the element itself.</DD>
     <DT>"afterbegin"</DT>
     <DD>Just inside the element, before its first child.</DD>
     <DT>"beforeend"</DT>
     <DD>Just inside the element, after its last child.</DD>
     <DT>"afterend"</DT>
     <DD>After the element itself.</DD>
    </DL><P>Throws a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception if the arguments
    have invalid values (e.g., in the case of <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents">XML
    documents</A>, if the given string is not well-formed).</P>

    <P>Throws a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</A></CODE> exception if
    the given position isn't possible (e.g. inserting elements after
    the root element of a <CODE>Document</CODE>).</P>

   </DD>

  </DL><DIV class="impl">

  <P>The <DFN id="dom-insertadjacenthtml" title="dom-insertAdjacentHTML"><CODE>insertAdjacentHTML(<VAR title="">position</VAR>, <VAR title="">text</VAR>)</CODE></DFN>
  method, when invoked, must run the following algorithm:</P>

  <OL><LI>

    <P>Let <VAR title="">position</VAR> and <VAR title="">text</VAR>
    be the method's first and second arguments, respectively.</P>

   </LI>

   <LI>

    <P>Let <VAR title="">target</VAR> be the element on which the
    method was invoked.</P>

   </LI>

   <LI>

    <P>Use the first matching item from this list:</P>

    <DL><DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "beforebegin"</DT>
     <DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "afterend"</DT>

     <DD>

      <P>If <VAR title="">target</VAR> has no parent node, then abort
      these steps.</P>

      <P>If <VAR title="">target</VAR>'s parent node is a
      <CODE>Document</CODE> object, then throw a
      <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</A></CODE> exception and abort
      these steps.

      </P><P>Otherwise, let <VAR title="">context</VAR> be the parent node
      of <VAR title="">target</VAR>.</P>

     </DD>

     <DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "afterbegin"</DT>
     <DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "beforeend"</DT>

     <DD>

      <P>Let <VAR title="">context</VAR> be the same as <VAR title="">target</VAR>.</P>

     </DD>

     <DT>Otherwise</DT>

     <DD>

      <P>Throw a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#syntax_err">SYNTAX_ERR</A></CODE> exception.</P>

     </DD>

    </DL></LI>

   <LI>

    <P>If <VAR title="">target</VAR>'s document is an <A href="http://dev.w3.org/html5/spec/Overview.html#html-documents" title="HTML documents">HTML document</A>: Invoke the <A href="http://dev.w3.org/html5/spec/Overview.html#html-fragment-parsing-algorithm">HTML
    fragment parsing algorithm</A>.</P>

    <P>If <VAR title="">target</VAR>'s document is an <A href="http://dev.w3.org/html5/spec/Overview.html#xml-documents" title="XML
    documents">XML document</A>: Invoke the <A href="http://dev.w3.org/html5/spec/Overview.html#xml-fragment-parsing-algorithm">XML fragment
    parsing algorithm</A>.</P>

    <P>In either case, the algorithm must be invoked with <VAR title="">text</VAR> as the <VAR title="">input</VAR>, and the
    element selected in by the previous step as the <VAR title="">context</VAR> element.</P>

    <P>If this raises an exception, then abort these steps.</P>

    <P>Otherwise, let <VAR title="">new children</VAR> be the nodes
    returned.</P>

   </LI>

   <LI>

    <P>Set the <CODE title="">ownerDocument</CODE> of all the nodes in
    <VAR title="">new children</VAR> to <VAR title="">target</VAR>'s
    document.</P>

   </LI>

   <LI>

    <P>Use the first matching item from this list:</P>

    <DL><DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "beforebegin"</DT>

     <DD>

      <P>Insert all the <VAR title="">new children</VAR> nodes
      immediately before <VAR title="">target</VAR>.</P>

     </DD>

     <DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "afterbegin"</DT>

     <DD>

      <P>Insert all the <VAR title="">new children</VAR> nodes before
      the first child of <VAR title="">target</VAR>, if there is
      one. If there is no such child, append them all to <VAR title="">target</VAR>.</P>

     </DD>

     <DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "beforeend"</DT>

     <DD>

      <P>Append all the <VAR title="">new children</VAR> nodes to <VAR title="">target</VAR>.</P>

     </DD>

     <DT>If <VAR title="">position</VAR> is an <A href="http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive">ASCII
     case-insensitive</A> match for the string "afterend"</DT>

     <DD>

      <P>Insert all the <VAR title="">new children</VAR> nodes
      immediately after <VAR title="">target</VAR>.</P>

     </DD>

    </DL><P>The <VAR title="">new children</VAR> nodes must be inserted in
    a manner that preserves their order and fires mutation events as
    if a <CODE>DocumentFragment</CODE> containing the <VAR title="">new children</VAR> had been inserted.</P>

   </LI>

  </OL></DIV><H2 id="semantics"><SPAN class="secno">4 </SPAN>The elements of HTML</H2><H3 id="the-root-element"><SPAN class="secno">4.1 </SPAN>The root element</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><H4 id="the-html-element-0"><SPAN class="secno">4.1.1 </SPAN>The <DFN><CODE>html</CODE></DFN> element</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><DL class="element"><DT>Categories</DT>
   <DD>None.</DD>
   <DT>Contexts in which this element may be used:</DT>
   <DD>As the root element of a document.</DD>
   <DD>Wherever a subdocument fragment is allowed in a compound document.</DD>
   <DT>Content model:</DT>
   <DD>A <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element followed by a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-body-element-0">body</A></CODE> element.</DD>
   <DT>Content attributes:</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#global-attributes">Global attributes</A></DD>
   <DD><CODE title="attr-html-manifest"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-html-manifest">manifest</A></CODE></DD>
   <DT>DOM interface:</DT>
   <DD>
    <PRE class="idl">interface <DFN id="htmlhtmlelement">HTMLHtmlElement</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> {};</PRE>
   </DD>
  </DL><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element <A href="http://dev.w3.org/html5/spec/Overview.html#represents">represents</A> the root of
  an HTML document.</P><P>The <DFN id="attr-html-manifest" title="attr-html-manifest"><CODE>manifest</CODE></DFN>
  attribute gives the address of the document's <A href="http://dev.w3.org/html5/spec/Overview.html#application-cache">application
  cache</A> <A href="http://dev.w3.org/html5/spec/Overview.html#concept-appcache-manifest" title="concept-appcache-manifest">manifest</A>, if there is
  one. If the attribute is present, the attribute's value must be a
  <A href="http://dev.w3.org/html5/spec/Overview.html#valid-url">valid URL</A>.</P><P>The <CODE title="attr-html-manifest"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-html-manifest">manifest</A></CODE> attribute
  only <A href="http://dev.w3.org/html5/spec/Overview.html#concept-appcache-init" title="concept-appcache-init">has an effect</A> during
  the early stages of document load. Changing the attribute
  dynamically thus has no effect (and thus, no DOM API is provided for
  this attribute).</P><P class="note">For the purposes of <A href="http://dev.w3.org/html5/spec/Overview.html#concept-appcache-init" title="concept-appcache-init">application cache selection</A>,
  later <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> elements cannot affect the <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a url">resolving of relative URLs</A> in <CODE title="attr-html-manifest"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-html-manifest">manifest</A></CODE> attributes, as the
  attributes are processed before those elements are seen.</P><DIV class="example">

   <P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element in the following example declares
   that the document's language is English.</P>

   <PRE>&lt;!DOCTYPE html&gt;
<STRONG>&lt;html lang="en"&gt;</STRONG>
&lt;head&gt;
&lt;title&gt;Swapping Songs&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Swapping Songs&lt;/h1&gt;
&lt;p&gt;Tonight I swapped some of the songs I wrote with some friends, who
gave me some of the songs they wrote. I love sharing my music.&lt;/p&gt;
&lt;/body&gt;
<STRONG>&lt;/html&gt;</STRONG></PRE>

  </DIV><H3 id="document-metadata"><SPAN class="secno">4.2 </SPAN>Document metadata</H3><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><H4 id="the-head-element-0"><SPAN class="secno">4.2.1 </SPAN>The <DFN><CODE>head</CODE></DFN> element</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><DL class="element"><DT>Categories</DT>
   <DD>None.</DD>
   <DT>Contexts in which this element may be used:</DT>
   <DD>As the first element in an <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element.</DD>
   <DT>Content model:</DT>
   <DD>If the document is <A href="http://dev.w3.org/html5/spec/Overview.html#an-iframe-srcdoc-document">an <CODE>iframe</CODE> <CODE title="attr-iframe-srcdoc">srcdoc</CODE> document</A>: Zero or more elements of <A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">metadata content</A>.</DD>
   <DD>Otherwise: One or more elements of <A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">metadata content</A>, of which exactly one is a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element.</DD>
   <DT>Content attributes:</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#global-attributes">Global attributes</A></DD>
   <DT>DOM interface:</DT>
   <DD>
    <PRE class="idl">interface <DFN id="htmlheadelement">HTMLHeadElement</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> {};</PRE>
   </DD>
  </DL><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element <A href="http://dev.w3.org/html5/spec/Overview.html#represents">represents</A> a
  collection of metadata for the <CODE>Document</CODE>.</P><DIV class="example">

   <P>The collection of metadata in a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element can be
   large or small. Here is an example of a very short one:</P>

   <PRE>&lt;!doctype html&gt;
&lt;html&gt;
 &lt;head&gt;
  &lt;title&gt;A document with a short head&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
 ...</PRE>

   <P>Here is an example of a longer one:</P>

   <PRE>&lt;!DOCTYPE HTML&gt;
&lt;HTML&gt;
 &lt;HEAD&gt;
  &lt;META CHARSET="UTF-8"&gt;
  &lt;BASE HREF="http://www.example.com/"&gt;
  &lt;TITLE&gt;An application with a long head&lt;/TITLE&gt;
  &lt;LINK REL="STYLESHEET" HREF="default.css"&gt;
  &lt;LINK REL="STYLESHEET ALTERNATE" HREF="big.css" TITLE="Big Text"&gt;
  &lt;SCRIPT SRC="support.js"&gt;&lt;/SCRIPT&gt;
  &lt;META NAME="APPLICATION-NAME" CONTENT="Long headed application"&gt;
 &lt;/HEAD&gt;
 &lt;BODY&gt;
 ...</PRE>

  </DIV><H4 id="the-title-element-0"><SPAN class="secno">4.2.2 </SPAN>The <DFN><CODE>title</CODE></DFN> element</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><DL class="element"><DT>Categories</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">Metadata content</A>.</DD>
   <DT>Contexts in which this element may be used:</DT>
   <DD>In a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element containing no other <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> elements.</DD>
   <DT>Content model:</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#text-content" title="text content">Text</A>.</DD>
   <DT>Content attributes:</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#global-attributes">Global attributes</A></DD>
   <DT>DOM interface:</DT>
   <DD>
    <PRE class="idl">interface <DFN id="htmltitleelement">HTMLTitleElement</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> {
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-title-text" title="dom-title-text">text</A>;
};</PRE>
   </DD>
  </DL><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element <A href="http://dev.w3.org/html5/spec/Overview.html#represents">represents</A> the
  document's title or name. Authors should use titles that identify
  their documents even when they are used out of context, for example
  in a user's history or bookmarks, or in search results. The
  document's title is often different from its first heading, since the
  first heading does not have to stand alone when taken out of
  context.</P><P>There must be no more than one <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element per
  document.</P><DL class="domintro"><DT><VAR title="">title</VAR> . <CODE title="dom-title-text"><A href="http://dev.w3.org/html5/spec/Overview.html#dom-title-text">text</A></CODE> [ = <VAR title="">value</VAR> ]</DT>

   <DD>

    <P>Returns the contents of the element, ignoring child nodes that
    aren't <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text node">text nodes</A>.</P>

    <P>Can be set, to replace the element's children with the given
    value.</P>

   </DD>

  </DL><DIV class="impl">

  <P>The IDL attribute <DFN id="dom-title-text" title="dom-title-text"><CODE>text</CODE></DFN> must return a
  concatenation of the contents of all the <A href="http://dev.w3.org/html5/spec/Overview.html#text-node" title="text
  node">text nodes</A> that are direct children of the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-title-element-0">title</A></CODE> element (ignoring any other nodes such as
  comments or elements), in tree order. On setting, it must act the
  same way as the <CODE>textContent</CODE> IDL attribute.</P>

  </DIV><DIV class="example">

   <P>Here are some examples of appropriate titles, contrasted with
   the top-level headings that might be used on those same pages.</P>

   <PRE>  &lt;title&gt;Introduction to The Mating Rituals of Bees&lt;/title&gt;
    ...
  &lt;h1&gt;Introduction&lt;/h1&gt;
  &lt;p&gt;This companion guide to the highly successful
  &lt;cite&gt;Introduction to Medieval Bee-Keeping&lt;/cite&gt; book is...</PRE>

   <P>The next page might be a part of the same site. Note how the
   title describes the subject matter unambiguously, while the first
   heading assumes the reader knows what the context is and therefore
   won't wonder if the dances are Salsa or Waltz:</P>

   <PRE>  &lt;title&gt;Dances used during bee mating rituals&lt;/title&gt;
    ...
  &lt;h1&gt;The Dances&lt;/h1&gt;</PRE>

  </DIV><P>The string to use as the document's title is given by the <CODE title="dom-document-title"><A href="http://dev.w3.org/html5/spec/Overview.html#document.title">document.title</A></CODE> IDL
  attribute. <SPAN class="impl">User agents should use the document's
  title when referring to the document in their user
  interface.</SPAN></P><H4 id="the-base-element"><SPAN class="secno">4.2.3 </SPAN>The <DFN><CODE>base</CODE></DFN> element</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><DL class="element"><DT>Categories</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">Metadata content</A>.</DD>
   <DT>Contexts in which this element may be used:</DT>
   <DD>In a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element containing no other <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> elements.</DD>
   <DT>Content model:</DT>
   <DD>Empty.</DD>
   <DT>Content attributes:</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#global-attributes">Global attributes</A></DD>
   <DD><CODE title="attr-base-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-href">href</A></CODE></DD>
   <DD><CODE title="attr-base-target"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-target">target</A></CODE></DD>
   <DT>DOM interface:</DT>
   <DD>
<PRE class="idl">interface <DFN id="htmlbaseelement">HTMLBaseElement</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> {
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-base-href" title="dom-base-href">href</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-base-target" title="dom-base-target">target</A>;
};</PRE>
   </DD>
  </DL><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> element allows authors to specify the
  <A href="http://dev.w3.org/html5/spec/Overview.html#document-base-url">document base URL</A> for the purposes of <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a url">resolving relative URLs</A>, and the name
  of the default <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing context</A> for the purposes of
  <A href="http://dev.w3.org/html5/spec/Overview.html#following-hyperlinks">following hyperlinks</A>. The element does not <A href="http://dev.w3.org/html5/spec/Overview.html#represents" title="represents">represent</A> any content beyond this
  information.</P><P>There must be no more than one <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> element per
  document.</P><P>A <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> element must have either an <CODE title="attr-base-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-href">href</A></CODE> attribute, a <CODE title="attr-base-target"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-target">target</A></CODE> attribute, or both.</P><P>The <DFN id="attr-base-href" title="attr-base-href"><CODE>href</CODE></DFN> content
  attribute, if specified, must contain a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-url">valid URL</A>.</P><P>A <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> element, if it has an <CODE title="attr-base-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-href">href</A></CODE> attribute, must come before any
  other elements in the tree that have attributes defined as taking
  <A href="http://dev.w3.org/html5/spec/Overview.html#url" title="URL">URLs</A>, except the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-html-element-0">html</A></CODE> element
  (its <CODE title="attr-html-manifest"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-html-manifest">manifest</A></CODE> attribute
  isn't affected by <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> elements).</P><DIV class="impl">

  <P class="note">If there are multiple <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> elements
  with <CODE title="attr-base-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-href">href</A></CODE> attributes, all but the
  first are ignored.</P>

  </DIV><P>The <DFN id="attr-base-target" title="attr-base-target"><CODE>target</CODE></DFN>
  attribute, if specified, must contain a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-browsing-context-name-or-keyword">valid browsing context
  name or keyword</A>, which specifies which <A href="http://dev.w3.org/html5/spec/Overview.html#browsing-context">browsing
  context</A> is to be used as the default when <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink" title="hyperlink">hyperlinks</A> and <A href="http://dev.w3.org/html5/spec/Overview.html#the-form-element" title="form">forms</A> in the <CODE>Document</CODE> cause <A href="http://dev.w3.org/html5/spec/Overview.html#navigate" title="navigate">navigation</A>.</P><P>A <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> element, if it has a <CODE title="attr-base-target"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-target">target</A></CODE> attribute, must come before
  any elements in the tree that represent <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink" title="hyperlink">hyperlinks</A>.</P><DIV class="impl">

  <P class="note">If there are multiple <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> elements
  with <CODE title="attr-base-target"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-base-target">target</A></CODE> attributes, all but
  the first are ignored.</P>

  <P>The <DFN id="dom-base-href" title="dom-base-href"><CODE>href</CODE></DFN> and <DFN id="dom-base-target" title="dom-base-target"><CODE>target</CODE></DFN> IDL attributes
  must <A href="http://dev.w3.org/html5/spec/Overview.html#reflect">reflect</A> the respective content attributes of the
  same name.</P>

  </DIV><DIV class="example">

   <P>In this example, a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-base-element">base</A></CODE> element is used to set the
   <A href="http://dev.w3.org/html5/spec/Overview.html#document-base-url">document base URL</A>:</P>

   <PRE>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;This is an example for the &amp;lt;base&amp;gt; element&lt;/title&gt;
        &lt;base href="http://www.example.com/news/index.html"&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;p&gt;Visit the &lt;a href="archives.html"&gt;archives&lt;/a&gt;.&lt;/p&gt;
    &lt;/body&gt;
&lt;/html&gt;</PRE>

   <P>The link in the above example would be a link to "<CODE title="">http://www.example.com/news/archives.html</CODE>".</P>

  </DIV><H4 id="the-link-element"><SPAN class="secno">4.2.4 </SPAN>The <DFN><CODE>link</CODE></DFN> element</H4><P class="XXX annotation"><B>Status: </B><I>Last call for comments</I></P><DL class="element"><DT>Categories</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">Metadata content</A>.</DD>
   <DT>Contexts in which this element may be used:</DT>
   <DD>Where <A href="http://dev.w3.org/html5/spec/Overview.html#metadata-content">metadata content</A> is expected.</DD>
   <DD>In a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-noscript-element">noscript</A></CODE> element that is a child of a <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-head-element-0">head</A></CODE> element.</DD>
   <DT>Content model:</DT>
   <DD>Empty.</DD>
   <DT>Content attributes:</DT>
   <DD><A href="http://dev.w3.org/html5/spec/Overview.html#global-attributes">Global attributes</A></DD>
   <DD><CODE title="attr-link-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-href">href</A></CODE></DD>
   <DD><CODE title="attr-link-rel"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-rel">rel</A></CODE></DD>
   <DD><CODE title="attr-link-media"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-media">media</A></CODE></DD>
   <DD><CODE title="attr-link-hreflang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-hreflang">hreflang</A></CODE></DD>
   <DD><CODE title="attr-link-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-type">type</A></CODE></DD>
   <DD><CODE title="attr-link-sizes"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-sizes">sizes</A></CODE></DD>
   <DD>Also, the <CODE title="attr-link-title"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-title">title</A></CODE> attribute has special semantics on this element.</DD>
   <DT>DOM interface:</DT>
   <DD>
<PRE class="idl">interface <DFN id="htmllinkelement">HTMLLinkElement</DFN> : <A href="http://dev.w3.org/html5/spec/Overview.html#htmlelement">HTMLElement</A> {
           attribute boolean <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-disabled" title="dom-link-disabled">disabled</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-href" title="dom-link-href">href</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-rel" title="dom-link-rel">rel</A>;
  readonly attribute DOMTokenList <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-rellist" title="dom-link-relList">relList</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-media" title="dom-link-media">media</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-hreflang" title="dom-link-hreflang">hreflang</A>;
           attribute DOMString <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-type" title="dom-link-type">type</A>;
  [PutForwards=<A href="http://dev.w3.org/html5/spec/Overview.html#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</A>] readonly attribute <A href="http://dev.w3.org/html5/spec/Overview.html#domsettabletokenlist">DOMSettableTokenList</A> <A href="http://dev.w3.org/html5/spec/Overview.html#dom-link-sizes" title="dom-link-sizes">sizes</A>;
};
<A href="http://dev.w3.org/html5/spec/Overview.html#htmllinkelement">HTMLLinkElement</A> implements <SPAN>LinkStyle</SPAN>;</PRE>
   </DD>
  </DL><P>The <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element allows authors to link their
  document to other resources.</P><P>The destination of the link(s) is given by the <DFN id="attr-link-href" title="attr-link-href"><CODE>href</CODE></DFN> attribute, which must
  be present and must contain a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-url">valid URL</A>. <SPAN class="impl">If the <CODE title="attr-link-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-href">href</A></CODE>
  attribute is absent, then the element does not define a
  link.</SPAN></P><P>A <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element must have <CODE title="attr-link-rel"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-rel">rel</A></CODE> attribute.</P><P>The types of link indicated (the relationships) are given by the
  value of the <DFN id="attr-link-rel" title="attr-link-rel"><CODE>rel</CODE></DFN>
  attribute, which, if present, must have a value that is a <A href="http://dev.w3.org/html5/spec/Overview.html#set-of-space-separated-tokens">set
  of space-separated tokens</A>. The <A href="http://dev.w3.org/html5/spec/Overview.html#linkTypes">allowed
  values and their meanings</A> are defined in a later section. <SPAN class="impl">If the <CODE title="attr-link-rel"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-rel">rel</A></CODE> attribute
  is absent, or if the values used are not allowed according to the
  definitions in this specification, then the element does not define
  a link.</SPAN></P><P>Two categories of links can be created using the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element. <DFN id="external-resource-link" title="external resource link">Links
  to external resources</DFN> are links to resources that are to be
  used to augment the current document, and <DFN id="hyperlink-link" title="hyperlink
  link">hyperlink links</DFN> are <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink" title="hyperlink">links to
  other documents</A>. The <A href="http://dev.w3.org/html5/spec/Overview.html#linkTypes">link types
  section</A> defines whether a particular link type is an external
  resource or a hyperlink. One element can create multiple links (of
  which some might be external resource links and some might be
  hyperlinks); exactly which and how many links are created depends on
  the keywords given in the <CODE title="attr-link-rel"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-rel">rel</A></CODE>
  attribute. User agents must process the links on a per-link basis,
  not a per-element basis.</P><P class="note">Each link is handled separately. For instance, if
  there are two <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> elements with <CODE title="">rel="stylesheet"</CODE>, they each count as a separate
  external resource, and each is affected by its own attributes
  independently.</P><P>The exact behavior for links to external resources depends on the
  exact relationship, as defined for the relevant link type. Some of
  the attributes control whether or not the external resource is to be
  applied (as defined below). <SPAN class="impl">For external
  resources that are represented in the DOM (for example, style
  sheets), the DOM representation must be made available even if the
  resource is not applied. To <DFN id="concept-link-obtain" title="concept-link-obtain">obtain
  the resource</DFN>, the user agent must <A href="http://dev.w3.org/html5/spec/Overview.html#resolve-a-url" title="resolve a
  url">resolve</A> the <A href="http://dev.w3.org/html5/spec/Overview.html#url">URL</A> given by the <CODE title="attr-link-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-href">href</A></CODE> attribute, relative to the
  element, and then <A href="http://dev.w3.org/html5/spec/Overview.html#fetch">fetch</A> the resulting <A href="http://dev.w3.org/html5/spec/Overview.html#absolute-url">absolute
  URL</A>. User agents may opt to only try to obtain such resources
  when they are needed, instead of pro-actively <A href="http://dev.w3.org/html5/spec/Overview.html#fetch" title="fetch">fetching</A> all the external resources that are
  not applied.</SPAN></P><!-- http-origin privacy sensitive --><DIV class="impl">

  <P>The semantics of the protocol used (e.g. HTTP) must be followed
  when fetching external resources. (For example, redirects will be
  followed and 404 responses will cause the external resource to not
  be applied.)</P>

  <!-- the next few paragraph are similar to text in the <style> section -->
  <P>Once the attempts to obtain the resource and its critical
  subresources are complete, the user agent must, if the loads were
  successful, <A href="http://dev.w3.org/html5/spec/Overview.html#queue-a-task">queue a task</A> to <A href="http://dev.w3.org/html5/spec/Overview.html#fire-a-simple-event">fire a simple
  event</A> named <CODE title="event-load">load</CODE> at the
  <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element, or, if the resource or one of its
  critical subresources failed to completely load for any reason
  (e.g. DNS error, HTTP 404 response, a connection being prematurely
  closed, unsupported Content-Type), <A href="http://dev.w3.org/html5/spec/Overview.html#queue-a-task">queue a task</A> to
  <A href="http://dev.w3.org/html5/spec/Overview.html#fire-a-simple-event">fire a simple event</A> named <CODE title="event-error">error</CODE> at the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE>
  element. Non-network errors in processing the resource or its
  subresources (e.g. CSS parse errors, PNG decoding errors) are not
  failures for the purposes of this paragraph.</P>

  <P>The <A href="http://dev.w3.org/html5/spec/Overview.html#task-source">task source</A> for these <A href="http://dev.w3.org/html5/spec/Overview.html#concept-task" title="concept-task">tasks</A> is the <A href="http://dev.w3.org/html5/spec/Overview.html#dom-manipulation-task-source">DOM manipulation
  task source</A>.</P>

  <P>The element must <A href="http://dev.w3.org/html5/spec/Overview.html#delay-the-load-event">delay the load event</A> of the
  element's document until all the attempts to obtain the resource and
  its critical subresources are complete. (Resources that the user
  agent has not yet attempted to obtain, e.g. because it is waiting
  for the resource to be needed, do not <A href="http://dev.w3.org/html5/spec/Overview.html#delay-the-load-event">delay the load
  event</A>.)</P>

  <P>Which resources are considered critical or not is defined by the
  relevant specification. For CSS resources, only <CODE title="">@import</CODE> rules introduce critical subresources; other
  resources, e.g. fonts or backgrounds, are not.</P>

  <HR><P id="linkui">Interactive user agents may provide users with a
  means to <A href="http://dev.w3.org/html5/spec/Overview.html#following-hyperlinks" title="following hyperlinks">follow the
  hyperlinks</A> created using the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element,
  somewhere within their user interface. The exact interface is not
  defined by this specification, but it could include the following
  information (obtained from the element's attributes, again as
  defined below), in some form or another (possibly simplified), for
  each hyperlink created with each <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element in the
  document:</P>

  <UL><!-- the order here is the order that makes most sense for a UI --><LI>The relationship between this document and the resource (given
   by the <CODE title="attr-link-rel"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-rel">rel</A></CODE> attribute)</LI>

   <LI>The title of the resource (given by the <CODE title="attr-link-title"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-title">title</A></CODE> attribute).</LI>

   <LI>The address of the resource (given by the <CODE title="attr-link-href"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-href">href</A></CODE> attribute).</LI>

   <LI>The language of the resource (given by the <CODE title="attr-link-hreflang"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-hreflang">hreflang</A></CODE> attribute).</LI>

   <LI>The optimum media for the resource (given by the <CODE title="attr-link-media"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-media">media</A></CODE> attribute).</LI>

  </UL><P>User agents could also include other information, such as the
  type of the resource (as given by the <CODE title="attr-link-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-type">type</A></CODE> attribute).</P>

  </DIV><P class="note">Hyperlinks created with the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE>
  element and its <CODE title="attr-link-rel"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-rel">rel</A></CODE> attribute
  apply to the whole page. This contrasts with the <CODE title="attr-hyperlink-rel"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-rel">rel</A></CODE> attribute of <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">a</A></CODE>
  and <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-area-element">area</A></CODE> elements, which indicates the type of a link
  whose context is given by the link's location within the
  document.</P><P>The <DFN id="attr-link-media" title="attr-link-media"><CODE>media</CODE></DFN>
  attribute says which media the resource applies to. The value must
  be a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-media-query">valid media query</A>.</P><DIV class="impl">

  <P>If the link is a <A href="http://dev.w3.org/html5/spec/Overview.html#hyperlink-link" title="hyperlink link">hyperlink</A>
  then the <CODE title="attr-link-media"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-media">media</A></CODE> attribute is
  purely advisory, and describes for which media the document in
  question was designed.</P>

  <P>However, if the link is an <A href="http://dev.w3.org/html5/spec/Overview.html#external-resource-link">external resource link</A>,
  then the <CODE title="attr-link-media"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-media">media</A></CODE> attribute is
  prescriptive. The user agent must apply the external resource to a
  <A href="http://dev.w3.org/html5/spec/Overview.html#view">view</A> when the <CODE title="attr-link-media"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-media">media</A></CODE> attribute's value <A href="http://dev.w3.org/html5/spec/Overview.html#matches-the-environment">matches
  the environment</A> of that view and the other relevant
  conditions apply, and must not apply it otherwise.</P><!-- note
  similar text in <style> section -->

  <P class="note">The external resource might have further
  restrictions defined within that limit its applicability. For
  example, a CSS style sheet might have some <CODE title="">@media</CODE> blocks. This specification does not override
  such further restrictions or requirements.</P><!-- note similar text
  in <style> section -->

  </DIV><P id="default-media">The default, if the <CODE title="attr-link-media"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-media">media</A></CODE> attribute is omitted, is "<CODE title="">all</CODE>", meaning that by default links apply to all
  media.</P><P>The <DFN id="attr-link-hreflang" title="attr-link-hreflang"><CODE>hreflang</CODE></DFN>
  attribute on the <CODE><A href="http://dev.w3.org/html5/spec/Overview.html#the-link-element">link</A></CODE> element has the same semantics as
  the <A href="http://dev.w3.org/html5/spec/Overview.html#attr-hyperlink-hreflang" title="attr-hyperlink-hreflang"><CODE>hreflang</CODE>
  attribute on hyperlink elements</A>.</P><P>The <DFN id="attr-link-type" title="attr-link-type"><CODE>type</CODE></DFN> attribute
  gives the <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type">MIME type</A> of the linked resource. It is
  purely advisory.  The value must be a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-mime-type">valid MIME
  type</A>.</P><P>For <A href="http://dev.w3.org/html5/spec/Overview.html#external-resource-link" title="external resource link">external resource
  links</A>, the <CODE title="attr-link-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-type">type</A></CODE> attribute
  is used as a hint to user agents so that they can avoid fetching
  resources they do not support. <SPAN class="impl">If the attribute
  is present, then the user agent must assume that the resource is of
  the given type (even if that is not a <A href="http://dev.w3.org/html5/spec/Overview.html#valid-mime-type">valid MIME type</A>,
  e.g. the empty string). If the attribute is omitted, but the
  external resource link type has a default type defined, then the
  user agent must assume that the resource is of that type. If the UA
  does not support the given <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type">MIME type</A> for the given link
  relationship, then the UA should not <A href="http://dev.w3.org/html5/spec/Overview.html#concept-link-obtain" title="concept-link-obtain">obtain</A> the resource; if the UA
  does support the given <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type">MIME type</A> for the given link
  relationship, then the UA should <A href="http://dev.w3.org/html5/spec/Overview.html#concept-link-obtain" title="concept-link-obtain">obtain</A> the resource. If the
  attribute is omitted, and the external resource link type does not
  have a default type defined, but the user agent would <A href="http://dev.w3.org/html5/spec/Overview.html#concept-link-obtain" title="concept-link-obtain">obtain</A> the resource if the type
  was known and supported, then the user agent should <A href="http://dev.w3.org/html5/spec/Overview.html#concept-link-obtain" title="concept-link-obtain">obtain</A> the resource under the
  assumption that it will be supported.</SPAN></P><DIV class="impl">

  <P>User agents must not consider the <CODE title="attr-link-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-type">type</A></CODE> attribute authoritative —
  upon fetching the resource, user agents must not use the <CODE title="attr-link-type"><A href="http://dev.w3.org/html5/spec/Overview.html#attr-link-type">type</A></CODE> attribute to determine its actual
  type. Only the actual type (as defined in the next paragraph) is
  used to determine whether to <EM>apply</EM> the resource, not the
  aforementioned assumed type.</P>

  <P id="concept-link-type-sniffing">If the external resource link
  type defines rules for processing the resource's <A href="http://dev.w3.org/html5/spec/Overview.html#content-type" title="Content-Type">Content-Type metadata</A>, then those rules
  apply. Otherwise, if the resource is expected to be an image, user
  agents may apply the <A href="http://dev.w3.org/html5/spec/Overview.html#content-type-sniffing:-image" title="Content-Type sniffing:
  image">image sniffing rules</A>, with the <VAR title="">official
  type</VAR> being the type determined from the resource's <A href="http://dev.w3.org/html5/spec/Overview.html#content-type" title="Content-Type">Content-Type metadata</A>, and use the
  resulting sniffed type of the resource as if it was the actual
  type. Otherwise, if neither of these conditions apply or if the user
  agent opts not to apply the image sniffing rules, then the user
  agent must use the resource's <A href="http://dev.w3.org/html5/spec/Overview.html#content-type" title="Content-Type">Content-Type metadata</A> to determine the
  type of the resource. If there is no type metadata, but the external
  resource link type has a default type defined, then the user agent
  must assume that the resource is of that type.</P>

  <P class="note">The <CODE title="rel-stylesheet"><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-stylesheet">stylesheet</A></CODE>
  link type defines rules for processing the resource's <A href="http://dev.w3.org/html5/spec/Overview.html#content-type" title="Content-Type">Content-Type metadata</A>.</P>

  <P>Once the user agent has established the type of the resource, the
  user agent must apply the resource if it is of a supported type and
  the other relevant conditions apply, and must ignore the resource
  otherwise.</P>

  <DIV class="example">

   <P>If a document contains style sheet links labeled as follows:</P>

   <PRE>&lt;link rel="stylesheet" href="A" type="text/plain"&gt;
&lt;link rel="stylesheet" href="B" type="text/css"&gt;
&lt;link rel="stylesheet" href="C"&gt;</PRE>

   <P>...then a compliant UA that supported only CSS style sheets
   would fetch the B and C files, and skip the A file (since
   <CODE>text/plain</CODE> is not the <A href="http://dev.w3.org/html5/spec/Overview.html#mime-type">MIME type</A> for CSS style
   sheets).</P>

   <P>For files B and C, it would then check the actual types returned
   by the server. For those that are sent as <CODE>text/css</CODE>, it
   would apply the styles, but for those labeled as
   <CODE>text/plain</CODE>, or any other type, it would not.</P>

   <P>If one of the two files was returned without a
   <A href="http://dev.w3.org/html5/spec/Overview.html#content-type">Content-Type</A> metadata, or with a syntactically
   incorrect type like <CODE title="">Content-Type:&nbsp;"null"</CODE>, then the default type
   for <CODE title="rel-stylesheet"><A href="http://dev.w3.org/html5/spec/Overview.html#link-type-stylesheet">stylesheet</A></CODE> links would kick
   in. Since that default type is <CODE title="">text/css</CODE></P></DIV></DIV></BODY></HTML>